summaryrefslogtreecommitdiff
path: root/cpu/instructions/opcode.txt
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-02-15 22:01:03 -0500
committerTest_User <hax@andrewyu.org>2023-02-15 22:01:03 -0500
commita87935509535b933cf3f5f703f65daafcc8adc5c (patch)
treebd9f8f90f88c1dc727ab7adf4fec6de11f538e22 /cpu/instructions/opcode.txt
parent5a87ffe89c6509c295d22c9b105fa1126328f6c2 (diff)
downloadspecification-a87935509535b933cf3f5f703f65daafcc8adc5c.tar.gz
specification-a87935509535b933cf3f5f703f65daafcc8adc5c.zip
Make conditional stuff work nicely
Diffstat (limited to 'cpu/instructions/opcode.txt')
-rw-r--r--cpu/instructions/opcode.txt23
1 files changed, 14 insertions, 9 deletions
diff --git a/cpu/instructions/opcode.txt b/cpu/instructions/opcode.txt
index d69eda4..f43f58a 100644
--- a/cpu/instructions/opcode.txt
+++ b/cpu/instructions/opcode.txt
@@ -3,15 +3,20 @@ Binary format:
is_conditional:
- Appends 1 parameter to the normal parameter list for the instruction:
- Lowest 3 bits: flags for each of the following checked, from lowest to highest:
- Zero
- Overflow
- Carry
- Next 3 bits:
- Value for each of the above that it should match
- Remaining bits:
- Index into instruction queue for which result is to be compared
+ n: number of bits for current mode
+ s: minimum number of bits required to represent n-1
+ /: integer division
+
+ Appends 2 parameters to the normal parameter list for the instruction:
+ First parameter:
+ Lowest (n-s)/2 bits:
+ Which bits to check
+ Next (n-s)/2 bits:
+ Value for each of the above that it should match
+ Remaining bits:
+ Bitwise offset into second parameter for value to be used
+ Second parameter:
+ Value to be used
Conditional instructions will be executed after unconditional ones