Update Registers

2025-06-19 17:43:37 +01:00
parent 937693eb52
commit 8e18fa33f9
+13 -10
@@ -1,24 +1,27 @@
## Registers ## Registers
Below is a list of the registers: Below is a list of the registers:
| Hex | Register | Description | | Hex | Register | Description |
|----------------|----------|-----------------------------------------------------------------------------| |:----------------|:----------:|-----------------------------------------------------------------------------|
| System | MAR | Memory address register for the current instruction to be fetched from RAM.| | 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 | STS | Status register, stores flags from calculations and comparisons. |
| System | CIR | Current instruction register. | | System | CIR | Current instruction register. |
| System | PCX | Program counter. Stores the address of the next instruction | | System | PCX | Program counter. Stores the address of the next instruction |
| 0x00\dots 0x07 | RG0 \dots RG7 | General purpose registers for variables etc. | | System | MDR | Memory data register for moving data between RAM and registers
| 0x08 | ACC | Accumulator for storing outputs of calculations. | | 0x00-0x0F | RG0-RGF | General purpose registers for variables etc. |
| 0x09 | MDR | Memory data register for moving data between RAM and registers | | 0x10 | ACC | Accumulator for storing outputs of calculations. |
| 0x0A | SPR | Stack pointer. | | 0x11 | SPR | Stack pointer. |
| 0x0B | BPR | Stack base pointer. | | 0x12 | BPR | Stack base pointer. |
| 0x1C | RET | Return address register. | | 0x13 | RET | Return address register. |
| 0x1D | IDR | Interrupt descriptor register. Contains a pointer to the interrupt descriptor table.| | 0x14 | IDR | Interrupt descriptor register. Contains a pointer to the interrupt descriptor table.|
| 0x11\dots 0x1F | RESERVED | Reserved registers. | 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 ## STS --- Status Register
The status register stores the flags from calculations and comparisons. It is a register of 32 bits, with the following layout: 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 | | Bit | Name | Description | Boot Value |
|--------|--------------------|-----------------------------------------------------------------------------------------------|------------| |:--------:|--------------------|-----------------------------------------------------------------------------------------------|:------------:|
| 0 | Equal | Set if the result of the last comparison was equal. | 0 | | 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 | | 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 | | 2 | GreaterThanOrEqual | Set if the result of the last comparison was greater than or equal. | 0 |