Update Instruction Set

2025-06-16 16:06:32 +01:00
parent 35cd5929f3
commit 7e8af97aa7
+19 -5
@@ -5,11 +5,25 @@ Below is an overview of the instruction set and the various operands. This table
Also note that immediate (constant/literal) arguments are 16-bits long in I (immediate argument) typed instructions. For more information on this, refer to instruction encoding.
### Instruction Format
|Instruction Type| bits 0-7 | bits 8-15 | bits 16-23 | bits 23-31 |
|-|-|-|-|-|
|basic|opcode|operand 1|operand 2|operand 3|
|literal|opcode|value part 1|value part 2|value part 3|
| Type | Description |
| -- | -- |
| R | Used when an instruction takes one or more register arguments, but no immediates. This type is also used by shift and rotation operations, as it contains a 5 bit shift amount field. |
| I | Used when an instruction takes at most two register arguments as well as a halfword immediate argument. This is typically used by immediate arithmetic operations e.g. addi, as well as loads and stores (where a base register and immediate offset are passed).
Also used by branching instructions. The operand is a signed offset from the current value of PCX. |
| J | Used by jumps excluding jr, which uses a register as its argument.
Jumps are absolute addresses, but there is a 256MB region around PCX since the argument is 26 bits.
Since arguments are always word aligned, we bitshift left twice and set the upper 4 bits to match that of the value in PCX. This then forms a valid word-sized address. |
### Load/Store and Data Movement Instructions
| Hex | Code | Operands | Description |