summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-03-19 10:58:54 -0400
committerTest_User <hax@andrewyu.org>2023-03-19 10:58:54 -0400
commitba4ef2bfd07be3ec9a0ff0f167755d0f239b9d5c (patch)
treebdb5bfbc3737a8503647c1b446b284c4ce3bc8bd
parente4f85d2fe57613a94a9cb99e3aca4df91b639e31 (diff)
downloadspecification-ba4ef2bfd07be3ec9a0ff0f167755d0f239b9d5c.tar.gz
specification-ba4ef2bfd07be3ec9a0ff0f167755d0f239b9d5c.zip
Add data transfer instructions
-rw-r--r--cpu/instructions/transfer/exchange.txt10
-rw-r--r--cpu/instructions/transfer/move.txt10
-rw-r--r--cpu/instructions/transfer/pop.txt11
-rw-r--r--cpu/instructions/transfer/push.txt11
-rw-r--r--cpu/instructions/transfer/push_pop_notes.txt2
5 files changed, 44 insertions, 0 deletions
diff --git a/cpu/instructions/transfer/exchange.txt b/cpu/instructions/transfer/exchange.txt
new file mode 100644
index 0000000..de55413
--- /dev/null
+++ b/cpu/instructions/transfer/exchange.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ exchange <value0> <value1>
+
+Effect:
+ Atomically (from a multi-cpu perspective) sets <value0> to <value1>, and <value1> to <value0>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/transfer/move.txt b/cpu/instructions/transfer/move.txt
new file mode 100644
index 0000000..c17a4db
--- /dev/null
+++ b/cpu/instructions/transfer/move.txt
@@ -0,0 +1,10 @@
+Number of parameters: 2
+
+Usage:
+ move <output> <input>
+
+Effect:
+ Sets <output> to <input>
+
+Exceptions:
+ None
diff --git a/cpu/instructions/transfer/pop.txt b/cpu/instructions/transfer/pop.txt
new file mode 100644
index 0000000..e895022
--- /dev/null
+++ b/cpu/instructions/transfer/pop.txt
@@ -0,0 +1,11 @@
+Number of parameters: 1
+
+Usage:
+ pop <output>
+
+Effect:
+ Sets <output> to [SP], then increments SP by sizeof <output>
+ See ./push_pop_notes.txt
+
+Exceptions:
+ Stack error if [SP] is not readable
diff --git a/cpu/instructions/transfer/push.txt b/cpu/instructions/transfer/push.txt
new file mode 100644
index 0000000..9ea7f10
--- /dev/null
+++ b/cpu/instructions/transfer/push.txt
@@ -0,0 +1,11 @@
+Number of parameters: 1
+
+Usage:
+ push <value>
+
+Effect:
+ Decrements SP by sizeof <value>, then sets [SP] to <value>
+ See ./push_pop_notes.txt
+
+Exceptions:
+ Stack error if [SP] is not writable
diff --git a/cpu/instructions/transfer/push_pop_notes.txt b/cpu/instructions/transfer/push_pop_notes.txt
new file mode 100644
index 0000000..ae64f95
--- /dev/null
+++ b/cpu/instructions/transfer/push_pop_notes.txt
@@ -0,0 +1,2 @@
+Exact value to use for SP during push/pop instructions within the same queue is to be considered as if each push/pop instrction were executed sequentially according to their placement in the instruction queue
+Resulting SP written in the end is to be the sum of all changes from executed push/pop instructions in the queue