diff --git a/Instruction-Set.md b/Instruction-Set.md index 1eb7912..4c8b6ad 100644 --- a/Instruction-Set.md +++ b/Instruction-Set.md @@ -38,4 +38,19 @@ *NEG instruction: CF is set to 0 if destination=0 ### Instruction encoding -WIP \ No newline at end of file +Instructions are 1-3 words long and are fully defined by the first word. +In a basic instruction, the lower 6 bits of the first word of the instruction +are the opcode, and the remaining 12 bits are split into a 5 bit destination operand +and a 5 bit source operand. +In bits, a basic instruction has the format: `sssssdddddoooooo` + +Operand value: + +| Description | Value | +| --- | --- | +| Invalid or none | `00000` | +| Immediate value at IP+1 | `11111` | +| [Immediate value at IP+1] | `11110` | +| Register | `00001`-`01000` | +| [Register] | `01001`-`10000` | +| Register + Immediate value at IP+1 | `10001`-`11000` | \ No newline at end of file