From 5a87ffe89c6509c295d22c9b105fa1126328f6c2 Mon Sep 17 00:00:00 2001 From: Test_User Date: Wed, 15 Feb 2023 19:54:24 -0500 Subject: Add more instructions --- cpu/instructions/arithmetic/add.txt | 10 ++++++++++ cpu/instructions/arithmetic/decrement.txt | 10 ++++++++++ cpu/instructions/arithmetic/increment.txt | 10 ++++++++++ cpu/instructions/arithmetic/notes.txt | 4 ++++ cpu/instructions/arithmetic/subtract.txt | 10 ++++++++++ cpu/instructions/conditions/bitwise_condition.txt | 12 ++++++++++++ cpu/instructions/conditions/save_condition.txt | 18 ++++++++++++++++++ 7 files changed, 74 insertions(+) create mode 100644 cpu/instructions/arithmetic/add.txt create mode 100644 cpu/instructions/arithmetic/decrement.txt create mode 100644 cpu/instructions/arithmetic/increment.txt create mode 100644 cpu/instructions/arithmetic/notes.txt create mode 100644 cpu/instructions/arithmetic/subtract.txt create mode 100644 cpu/instructions/conditions/bitwise_condition.txt create mode 100644 cpu/instructions/conditions/save_condition.txt diff --git a/cpu/instructions/arithmetic/add.txt b/cpu/instructions/arithmetic/add.txt new file mode 100644 index 0000000..3668033 --- /dev/null +++ b/cpu/instructions/arithmetic/add.txt @@ -0,0 +1,10 @@ +Number of parameters: 3 + +Usage: + Add + +Effect: + Adds to and stores it in + +Exceptions: + None diff --git a/cpu/instructions/arithmetic/decrement.txt b/cpu/instructions/arithmetic/decrement.txt new file mode 100644 index 0000000..7d56a45 --- /dev/null +++ b/cpu/instructions/arithmetic/decrement.txt @@ -0,0 +1,10 @@ +Number of parameters: 1 + +Usage: + decrement + +Effect: + Subtracts 1 from + +Exceptions: + None diff --git a/cpu/instructions/arithmetic/increment.txt b/cpu/instructions/arithmetic/increment.txt new file mode 100644 index 0000000..60cd856 --- /dev/null +++ b/cpu/instructions/arithmetic/increment.txt @@ -0,0 +1,10 @@ +Number of parameters: 1 + +Usage: + increment + +Effect: + Adds 1 to + +Exceptions: + None diff --git a/cpu/instructions/arithmetic/notes.txt b/cpu/instructions/arithmetic/notes.txt new file mode 100644 index 0000000..29500cb --- /dev/null +++ b/cpu/instructions/arithmetic/notes.txt @@ -0,0 +1,4 @@ +Unless otherwise specified, all arithmetic instructions: + Set the zero flag when the result is 0 + Set the overflow flag when a signed operation results in inversion of the sign due to lack of bits to store the value + Set the carry flag when an unsigned operation results in a lower number due to lack of bits to store the value diff --git a/cpu/instructions/arithmetic/subtract.txt b/cpu/instructions/arithmetic/subtract.txt new file mode 100644 index 0000000..273ca46 --- /dev/null +++ b/cpu/instructions/arithmetic/subtract.txt @@ -0,0 +1,10 @@ +Number of parameters: 3 + +Usage: + Subtract + +Effect: + Subtracts from and stores it in + +Exceptions: + None diff --git a/cpu/instructions/conditions/bitwise_condition.txt b/cpu/instructions/conditions/bitwise_condition.txt new file mode 100644 index 0000000..48ddabd --- /dev/null +++ b/cpu/instructions/conditions/bitwise_condition.txt @@ -0,0 +1,12 @@ +Number of parameters: 3 + +Usage: + bitwise_condition + +Effect: + Sets the zero flag if exactly one of in match + Sets the overflow flag if at least one of in match + Sets the carry flag if all of in match + +Exceptions: + None diff --git a/cpu/instructions/conditions/save_condition.txt b/cpu/instructions/conditions/save_condition.txt new file mode 100644 index 0000000..a7df9d2 --- /dev/null +++ b/cpu/instructions/conditions/save_condition.txt @@ -0,0 +1,18 @@ +Number of parameters: + +Usage: + save_condition + +conditional parameter: same as is_conditional from ../opcode.txt, but with the following changes: + Values to be compared are instead xor'd + +Effect: + Saves the selected flags to at bitwise position + Flags are xor'd with the comparison value + Resulting value is shifted down to not have gaps from unused flags + +Exceptions: + None + +Notes: + Will be executed in the conditional phase -- cgit v1.2.3