From 22029d37cbf391a35304d32778bd01ecf40de482 Mon Sep 17 00:00:00 2001 From: Test_User Date: Mon, 13 Feb 2023 20:17:31 -0500 Subject: Rewrite/improve conditional instructions --- cpu/instructions/opcode.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 cpu/instructions/opcode.txt (limited to 'cpu/instructions/opcode.txt') diff --git a/cpu/instructions/opcode.txt b/cpu/instructions/opcode.txt new file mode 100644 index 0000000..d69eda4 --- /dev/null +++ b/cpu/instructions/opcode.txt @@ -0,0 +1,18 @@ +Binary format: + is_conditional[1], instruction id[remaining bits] + + +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 + + Conditional instructions will be executed after unconditional ones + + Conditional instructions will never set flags, if a conditional instruction references another, it will always be based on null flags -- cgit v1.2.3