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 ++++++++++ 5 files changed, 44 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 (limited to 'cpu/instructions/arithmetic') 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 -- cgit v1.2.3