Skip to content

Latest commit

 

History

History
104 lines (94 loc) · 3.2 KB

File metadata and controls

104 lines (94 loc) · 3.2 KB

Memory Layout

Retroputer has access to 512 kilobytes of memory, split up into eight banks of 64 kilobytes each. Only the first bank can contain executable code.

Each bank is then split up into four pages of 16 kilobytes. The initial memory map at boot-up looks like the following:

Memory Layout at boot-up

Bank Role
0

Trap Vectors

KERNEL Scratch and Sprite Data

System Stack

User Code

1 Screen Memory (by default)
2 General Purpose Data
3 General Purpose Data
4 General Purpose Data
5 General Purpose Data
6 General Purpose Data
7 ROM (Character, Palette, Kernel)

Each bank is split into four pages, resulting in 32 addressable pages. Pages 28–31 are read-only (being the entirety of bank 7). Pages 1–3 in bank 0 can be remapped with the MM register. At startup, the first four pages are mapped as follows:

Page Mapping Remappable? Role
0 0 No

Trap Vectors

Kernel Scratch and Sprite Data

Stack

User Code

1 1 Yes User Code and Data
2 2 Yes User Code and Data
3 31 Yes KERNEL (ROM)

Because MM can be modified with the PUSHMM instruction, it is posible to map in code and data from any page in memory. This means that it is possible, with some clever programming, to write programs with much more code than 64 kilobytes.