From 8e18fa33f960f567fdf36e7d2dcd42146a461184 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 19 Jun 2025 17:43:37 +0100 Subject: [PATCH] Update Registers --- Registers.md | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Registers.md b/Registers.md index 28cca40..c66eaf4 100644 --- a/Registers.md +++ b/Registers.md @@ -1,24 +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. +|:----------------|:----------:|-----------------------------------------------------------------------------| +| 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 | 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 |