3
Registers
zxq5 edited this page 2025-06-19 17:44:00 +01:00

Registers

Below is a list of the registers:

Hex Register Description
System MAR Memory address register for the current instruction to be fetched from RAM.
System STS Status register, stores flags from calculations and comparisons.
System CIR Current instruction register.
System PCX Program counter. Stores the address of the next instruction
System MDR Memory data register for moving data between RAM and registers
0x00-0x0F RG0-RGF 16 General purpose registers for variables etc.
0x10 ACC Accumulator for storing outputs of calculations.
0x11 SPR Stack pointer.
0x12 BPR Stack base pointer.
0x13 RET Return address register.
0x14 IDR Interrupt descriptor register. Contains a pointer to the interrupt descriptor table.
0x15 MMR Memory map register, contains a pointer to the hardware memory map.
0x16 ZERO Constant value of 0, may be used when a base register should just be 0. Loads/using as dest register must cause an illegal instruction trap.
0x17 NOREG Used when fields in an instruction are unused. Basically an empty field.
..=0x1F RESERVED Reserved registers.

STS --- Status Register

The status register stores the flags from calculations and comparisons. It is a register of 32 bits, with the following layout:

Bit Name Description Boot Value
0 Equal Set if the result of the last comparison was equal. 0
1 GreaterThan Set if the result of the last comparison was greater than. 0
2 GreaterThanOrEqual Set if the result of the last comparison was greater than or equal. 0
3 LessThan Set if the result of the last comparison was less than. 0
4 LessThanOrEqual Set if the result of the last comparison was less than or equal. 0
5 Zero Set if the result of the last arithmetic / logic operation was equal to zero 0