From cf81293d79cf3a5cfbcdb55eb6368bbcb5f06fd7 Mon Sep 17 00:00:00 2001 From: Test_User Date: Thu, 16 Feb 2023 14:57:20 -0500 Subject: Finish adding basic arithmetic instructions --- cpu/instructions/arithmetic/add_with_carry.txt | 10 ++++++++++ cpu/instructions/arithmetic/signed_divide.txt | 10 ++++++++++ cpu/instructions/arithmetic/signed_multiply.txt | 14 ++++++++++++++ cpu/instructions/arithmetic/subtract_with_borrow.txt | 10 ++++++++++ cpu/instructions/arithmetic/unsigned_divide.txt | 10 ++++++++++ cpu/instructions/arithmetic/unsigned_multiply.txt | 14 ++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 cpu/instructions/arithmetic/add_with_carry.txt create mode 100644 cpu/instructions/arithmetic/signed_divide.txt create mode 100644 cpu/instructions/arithmetic/signed_multiply.txt create mode 100644 cpu/instructions/arithmetic/subtract_with_borrow.txt create mode 100644 cpu/instructions/arithmetic/unsigned_divide.txt create mode 100644 cpu/instructions/arithmetic/unsigned_multiply.txt (limited to 'cpu/instructions/arithmetic') diff --git a/cpu/instructions/arithmetic/add_with_carry.txt b/cpu/instructions/arithmetic/add_with_carry.txt new file mode 100644 index 0000000..b5d4652 --- /dev/null +++ b/cpu/instructions/arithmetic/add_with_carry.txt @@ -0,0 +1,10 @@ +Number of parameters: 5 + +Usage: + add_with_carry + +Effect: + Adds ( + bit in ) to and stores it in + +Exceptions: + None diff --git a/cpu/instructions/arithmetic/signed_divide.txt b/cpu/instructions/arithmetic/signed_divide.txt new file mode 100644 index 0000000..2746f71 --- /dev/null +++ b/cpu/instructions/arithmetic/signed_divide.txt @@ -0,0 +1,10 @@ +Number of parameters: 4 + +Usage: + signed_divide + +Effect: + Performs the signed division /, storing the integer result in and the remainder in + +Exceptions: + Division by 0 diff --git a/cpu/instructions/arithmetic/signed_multiply.txt b/cpu/instructions/arithmetic/signed_multiply.txt new file mode 100644 index 0000000..8f5a8ac --- /dev/null +++ b/cpu/instructions/arithmetic/signed_multiply.txt @@ -0,0 +1,14 @@ +Number of parameters: 4 + +Usage: + signed_multiply + +Effect: + Performs the signed multiplication *, storing the integer result in and any overflowing bits into + +Exceptions: + None + +Flags: + Sets the overflow flag if : != + Carry flag is never set diff --git a/cpu/instructions/arithmetic/subtract_with_borrow.txt b/cpu/instructions/arithmetic/subtract_with_borrow.txt new file mode 100644 index 0000000..8f06e37 --- /dev/null +++ b/cpu/instructions/arithmetic/subtract_with_borrow.txt @@ -0,0 +1,10 @@ +Number of parameters: 5 + +Usage: + subtract_with_borrow + +Effect: + Subtracts ( + bit in ) from + +Exceptions: + None diff --git a/cpu/instructions/arithmetic/unsigned_divide.txt b/cpu/instructions/arithmetic/unsigned_divide.txt new file mode 100644 index 0000000..b08f2ea --- /dev/null +++ b/cpu/instructions/arithmetic/unsigned_divide.txt @@ -0,0 +1,10 @@ +Number of parameters: 4 + +Usage: + unsigned_divide + +Effect: + Performs the unsigned division /, storing the integer result in and the remainder in + +Exceptions: + Division by 0 diff --git a/cpu/instructions/arithmetic/unsigned_multiply.txt b/cpu/instructions/arithmetic/unsigned_multiply.txt new file mode 100644 index 0000000..da1cfbb --- /dev/null +++ b/cpu/instructions/arithmetic/unsigned_multiply.txt @@ -0,0 +1,14 @@ +Number of parameters: 4 + +Usage: + unsigned_multiply + +Effect: + Performs the unsigned multiplication *, storing the integer result in and any overflowing bits into + +Exceptions: + None + +Flags: + Sets the carry flag if the overflow was non-zero + The overflow flag is never set -- cgit v1.2.3