3 ms·
Just to point out: You can still do this (with any processor that has a zero-register, otherwise you'd still have to "burn" a register and you could just use a
by moring 4y ago
Just to point out: You can still do this (with any processor that has a zero-register, otherwise you'd still have to "burn" a register and you could just use a real global pointer). This technique isn't made impossible by larger RAM, it just cannot access anything beyond 4KiB (1). If that is enough for your "hot" data, you could still use it.
(1) 2KiB for RISCV, because immediate offsets are 12bits signed, and the upper end of the address space is usually not mapped to RAM. That is, 4KiB are possible with RISCV if you control the memory map.
- monocasa 4y agoA lot of processors don't even map usable RAM at address zero is the real problem. For instance a lot of simpler RISC-V chips are copying the basic Cortex-M memory map which places ROM low in memory. Even on systems with MMUs, it's very common that the kernel won't let you map RAM at address zero for several reasons. And the sizes are being talked about are about the size of a single page.