Skip to content

Memory Management

Peter Wilson edited this page Nov 23, 2022 · 1 revision

The hardware supports an extended 4MB address space split into 16K blocks. Any 16K block within this 4MB range can be mapped into one of the 4 physical 16K pages that make up the Z80 native address space. There are four page control registers controlling which block maps to each of the four pages.

ZLoader runs from SRAM page zero (block 20h). I uses SRAM blocks 21h-24h as a default 64K 'application space'. It is into these blocks that ZLoader will 'load' applications. When asked to 'run', ZLoader first maps the application space into page registers, suspends itself and runs the application.

The ZLoader debugger understands this block mapping so blocks are mapped in and out of memory pages as required while the loader itself continues to reside in block 20h.

Applications can write to the page registers to access additional memory blocks.