From 937693eb526dd663df2015c8e93cee6a1c4f3283 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 19 Jun 2025 17:38:12 +0100 Subject: [PATCH] Add Registers --- Registers.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Registers.md diff --git a/Registers.md b/Registers.md new file mode 100644 index 0000000..28cca40 --- /dev/null +++ b/Registers.md @@ -0,0 +1,27 @@ +## 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 | +| 0x00\dots 0x07 | RG0 \dots RG7 | General purpose registers for variables etc. | +| 0x08 | ACC | Accumulator for storing outputs of calculations. | +| 0x09 | MDR | Memory data register for moving data between RAM and registers | +| 0x0A | SPR | Stack pointer. | +| 0x0B | BPR | Stack base pointer. | +| 0x1C | RET | Return address register. | +| 0x1D | IDR | Interrupt descriptor register. Contains a pointer to the interrupt descriptor table.| +| 0x11\dots 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 | \ No newline at end of file