summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-06-14 04:04:22 -0400
committerTest_User <hax@andrewyu.org>2023-06-14 04:04:22 -0400
commitcdcb701aa48a974f97df31438f32071b3001ac7b (patch)
treef4b2ca636b5745e37fb362af2c3d9f511ecf5b1d
parent523518b60efde6a605a8fbc33f14f9924fd08d69 (diff)
downloadspecification-cdcb701aa48a974f97df31438f32071b3001ac7b.tar.gz
specification-cdcb701aa48a974f97df31438f32071b3001ac7b.zip
Add a bunch of fewer-parameter versions of instructions, specify that special returns only take effect after other writes complete
-rw-r--r--cpu/instructions/arithmetic/add_inplace.txt10
-rw-r--r--cpu/instructions/arithmetic/signed_divide_inplace.txt10
-rw-r--r--cpu/instructions/arithmetic/signed_multiply_inplace.txt14
-rw-r--r--cpu/instructions/arithmetic/subtract_inplace.txt10
-rw-r--r--cpu/instructions/arithmetic/unsigned_divide_inplace.txt10
-rw-r--r--cpu/instructions/arithmetic/unsigned_multiply_inplace.txt14
-rw-r--r--cpu/instructions/bitwise/and_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/arithmetic_shift_right_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/exclusive_or_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/not_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/or_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/rotate_left_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/rotate_right_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/shift_left_inplace.txt10
-rw-r--r--cpu/instructions/bitwise/shift_right_inplace.txt10
-rw-r--r--cpu/instructions/execution_control/iretde.txt2
-rw-r--r--cpu/instructions/execution_control/irete.txt2
-rw-r--r--cpu/instructions/execution_control/ireth.txt2
-rw-r--r--cpu/instructions/execution_control/irett.txt2
-rw-r--r--cpu/instructions/execution_control/ret.txt10
-rw-r--r--cpu/instructions/execution_control/tret.txt2
21 files changed, 178 insertions, 0 deletions
diff --git a/cpu/instructions/arithmetic/add_inplace.txt b/cpu/instructions/arithmetic/add_inplace.txt
new file mode 100644
index 0000000..66aeae6
--- /dev/null
+++ b/cpu/instructions/arithmetic/add_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ add_inplace <output> <value>
+
+Effect:
+ Adds <value> to <output> and stores it in <output>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/arithmetic/signed_divide_inplace.txt b/cpu/instructions/arithmetic/signed_divide_inplace.txt
new file mode 100644
index 0000000..875dd5e
--- /dev/null
+++ b/cpu/instructions/arithmetic/signed_divide_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ signed_divide_inplace <numerand> <divisor>
+
+Effect:
+ Performs the signed division <numerand>/<divisor>, storing the integer result in <numerand> and the remainder in <divisor>
+
+Exceptions:
+ Division by 0
diff --git a/cpu/instructions/arithmetic/signed_multiply_inplace.txt b/cpu/instructions/arithmetic/signed_multiply_inplace.txt
new file mode 100644
index 0000000..3ca0d0c
--- /dev/null
+++ b/cpu/instructions/arithmetic/signed_multiply_inplace.txt
@@ -0,0 +1,14 @@
+Number of parameters: 2
+
+Usage:
+ signed_multiply_inplace <value0> <value1>
+
+Effect:
+ Performs the signed multiplication <value0>*<value1>, storing the integer result in <value0> and any overflowing bits into <value1>
+
+Exceptions:
+ None
+
+Flags:
+ Sets the overflow flag if <overflow>:<result> != <result>
+ Carry flag is never set
diff --git a/cpu/instructions/arithmetic/subtract_inplace.txt b/cpu/instructions/arithmetic/subtract_inplace.txt
new file mode 100644
index 0000000..686e25b
--- /dev/null
+++ b/cpu/instructions/arithmetic/subtract_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ subtract_inplace <output> <value>
+
+Effect:
+ Subtracts <value> from <output> and stores it in <output>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/arithmetic/unsigned_divide_inplace.txt b/cpu/instructions/arithmetic/unsigned_divide_inplace.txt
new file mode 100644
index 0000000..66ca896
--- /dev/null
+++ b/cpu/instructions/arithmetic/unsigned_divide_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ unsigned_divide_inplace <numerand> <divisor>
+
+Effect:
+ Performs the unsigned division <numerand>/<divisor>, storing the integer result in <numerand> and the remainder in <divisor>
+
+Exceptions:
+ Division by 0
diff --git a/cpu/instructions/arithmetic/unsigned_multiply_inplace.txt b/cpu/instructions/arithmetic/unsigned_multiply_inplace.txt
new file mode 100644
index 0000000..f2d9770
--- /dev/null
+++ b/cpu/instructions/arithmetic/unsigned_multiply_inplace.txt
@@ -0,0 +1,14 @@
+Number of parameters: 2
+
+Usage:
+ unsigned_multiply_inplace <value0> <value1>
+
+Effect:
+ Performs the unsigned multiplication <value0>*<value1>, storing the integer result in <value0> and any overflowing bits into <value1>
+
+Exceptions:
+ None
+
+Flags:
+ Sets the carry flag if the overflow was non-zero
+ The overflow flag is never set
diff --git a/cpu/instructions/bitwise/and_inplace.txt b/cpu/instructions/bitwise/and_inplace.txt
new file mode 100644
index 0000000..21cb147
--- /dev/null
+++ b/cpu/instructions/bitwise/and_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ and_inplace <output> <value>
+
+Effect:
+ Sets <output> to the bitwise and of <value> and <output>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/arithmetic_shift_right_inplace.txt b/cpu/instructions/bitwise/arithmetic_shift_right_inplace.txt
new file mode 100644
index 0000000..9507e65
--- /dev/null
+++ b/cpu/instructions/bitwise/arithmetic_shift_right_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ arithmetic_shift_right_inplace <value> <amount>
+
+Effect:
+ Sets <value> to <value> shifted to the right <amount> bits, filling in leading bits with the most significant bit of <value>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/exclusive_or_inplace.txt b/cpu/instructions/bitwise/exclusive_or_inplace.txt
new file mode 100644
index 0000000..e0b4b47
--- /dev/null
+++ b/cpu/instructions/bitwise/exclusive_or_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ exclusive_or_inplace <output> <value>
+
+Effect:
+ Sets <output> to the bitwise exclusive or of <value> and <output>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/not_inplace.txt b/cpu/instructions/bitwise/not_inplace.txt
new file mode 100644
index 0000000..f854a8d
--- /dev/null
+++ b/cpu/instructions/bitwise/not_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 1
+
+Usage:
+ not_inplace <value>
+
+Effect:
+ Sets <value> to the bitwise not of <value>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/or_inplace.txt b/cpu/instructions/bitwise/or_inplace.txt
new file mode 100644
index 0000000..22598a3
--- /dev/null
+++ b/cpu/instructions/bitwise/or_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ or_inplace <output> <value>
+
+Effect:
+ Sets <output> to the bitwise or of <value> and <output>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/rotate_left_inplace.txt b/cpu/instructions/bitwise/rotate_left_inplace.txt
new file mode 100644
index 0000000..65424f5
--- /dev/null
+++ b/cpu/instructions/bitwise/rotate_left_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ rotate_left_inplace <value> <amount>
+
+Effect:
+ Sets <value> to <value> rotated to the left <amount> bits
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/rotate_right_inplace.txt b/cpu/instructions/bitwise/rotate_right_inplace.txt
new file mode 100644
index 0000000..18f7968
--- /dev/null
+++ b/cpu/instructions/bitwise/rotate_right_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ rotate_right_inplace <value> <amount>
+
+Effect:
+ Sets <value> to <value> rotated to the right <amount> bits
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/shift_left_inplace.txt b/cpu/instructions/bitwise/shift_left_inplace.txt
new file mode 100644
index 0000000..109e271
--- /dev/null
+++ b/cpu/instructions/bitwise/shift_left_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ shift_left_inplace <value> <amount>
+
+Effect:
+ Sets <value> to <value> shifted to the left <amount> bits
+
+Exceptions:
+ None
diff --git a/cpu/instructions/bitwise/shift_right_inplace.txt b/cpu/instructions/bitwise/shift_right_inplace.txt
new file mode 100644
index 0000000..4000d6e
--- /dev/null
+++ b/cpu/instructions/bitwise/shift_right_inplace.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ shift_right_inplace <value> <amount>
+
+Effect:
+ Sets <value> to <value> shifted to the right <amount> bits
+
+Exceptions:
+ None
diff --git a/cpu/instructions/execution_control/iretde.txt b/cpu/instructions/execution_control/iretde.txt
index 9e13fa5..9f1ed76 100644
--- a/cpu/instructions/execution_control/iretde.txt
+++ b/cpu/instructions/execution_control/iretde.txt
@@ -10,5 +10,7 @@ Effect:
PR is set to OPRDE
Will be considered to be in the previous exception handler
+ Only takes effect after all other writes are complete
+
Exceptions:
`Invalid operation` if not currently executing a double excetion handler
diff --git a/cpu/instructions/execution_control/irete.txt b/cpu/instructions/execution_control/irete.txt
index 273ea59..c057344 100644
--- a/cpu/instructions/execution_control/irete.txt
+++ b/cpu/instructions/execution_control/irete.txt
@@ -10,5 +10,7 @@ Effect:
PR is set to OPRE
No longer considered to be in an exception handler
+ Only takes effect after all other writes are complete
+
Exceptions:
`Invalid operation` if not currently executing an excetion handler
diff --git a/cpu/instructions/execution_control/ireth.txt b/cpu/instructions/execution_control/ireth.txt
index 54c92c8..955e1d3 100644
--- a/cpu/instructions/execution_control/ireth.txt
+++ b/cpu/instructions/execution_control/ireth.txt
@@ -10,5 +10,7 @@ Effect:
PR is set to OPRH
Hardware interrupts are allowed again
+ Only takes effect after all other writes are complete
+
Exceptions:
`Invalid operation` if not currently executing a hardware interrupt
diff --git a/cpu/instructions/execution_control/irett.txt b/cpu/instructions/execution_control/irett.txt
index 0ee81f0..4289420 100644
--- a/cpu/instructions/execution_control/irett.txt
+++ b/cpu/instructions/execution_control/irett.txt
@@ -6,6 +6,8 @@ Usage:
Effect:
See ../../task_switching/execution.txt
+ Only takes effect after all other writes are complete
+
Exceptions:
`Invalid operation` if not in an exception/interrupt handler
diff --git a/cpu/instructions/execution_control/ret.txt b/cpu/instructions/execution_control/ret.txt
new file mode 100644
index 0000000..cb3a1a2
--- /dev/null
+++ b/cpu/instructions/execution_control/ret.txt
@@ -0,0 +1,10 @@
+Number of parameters: 0
+
+Usage:
+ ret
+
+Effect:
+ Same as `pop IP`
+
+Exceptions:
+ None
diff --git a/cpu/instructions/execution_control/tret.txt b/cpu/instructions/execution_control/tret.txt
index 7b2cd9d..53b1097 100644
--- a/cpu/instructions/execution_control/tret.txt
+++ b/cpu/instructions/execution_control/tret.txt
@@ -6,6 +6,8 @@ Usage:
Effect:
See ../../task_switching/execution.txt
+ Only takes effect after all other writes are complete
+
Exceptions:
`Invalid operation` if not the original task