Devices

The machine has a number of devices attached to it. Each device can be accessed via memory addresses, or I/O ports. These access methods are called Memory Mapped I/O (MMIO), and Port Mapped I/O (PMIO) The memory address space, and the port address space are accessed via different instructions, as demonstrated below.

Example memory operations:

LOAD    R1, 420 ;   Read memory address 420 and load its value into R1.
STORE   R2, 52  ;   Write the value in R2 into memory address 52.

Example port operations:

IN      R3, =1  ;   Read from port 1 and load its value into R3.
OUT     R4, =0  ;   Write the value in R4 into port 4.

Device list

ImageCategoryNameDesc
image imageSystemRAMVolatile storage device.
image imageSystemRTCReal-Time Clock
image imageSystemCPUCPU
image imageSystemPIC(fix or remove) Interrupt controller
image imageHIDLegacy TerminalThe dumbest, simplest human interface.
image imageHIDPAD(TODO) Gamepad ports
image imageAudioPSGSimple audio chip.
image imageAudioMIDI(TODO) MIDI in / out
image imageVideodisplay_classicMemory mapped framebuffer

Open the device page for a more detailed explanation on its behaviour.

Memory Map

Addr range (hex)(decimal)NameDescription
0x0000..=0x1FFF0000..=8191RAM32 kB of ram
0x2000..=0x6AFF8192..=27391DisplayFramebuffer
0x6B00..=0x6B0F27392..=27407[[Interrupt Vector Table|Exceptions#Interrupt-Vector-Table]](TODO)

Ports

Port(dec)DeviceSymbolDesc
0x000legacytermCRTWriting to this port shows the user a number.
0x011legacytermKBDRead from here to request input from user.
0x022rtcRTCReal-Time Clock. Returns local Unix time (32-bit)
....
0x066STDIN-Dummy device. Don’t use.
0x077STDOUT-Dummy device. Don’t use.
....
0x2032pic-PIC 0: Command port
0x2133pic-PIC 1: Mask port
0x2234pic-PIC 2: Interrupt timer