summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-04-29 17:26:41 -0400
committerTest_User <hax@andrewyu.org>2023-04-29 17:26:41 -0400
commitfd9a62701e4048ac6004052471d58f6383597fa0 (patch)
treebde675af0cacb4e4b6c3da6bcf7f82092e1bc98c
parentc06c80180c4d2c4c1077eec38d86ae76b90e45b9 (diff)
downloadspecification-fd9a62701e4048ac6004052471d58f6383597fa0.tar.gz
specification-fd9a62701e4048ac6004052471d58f6383597fa0.zip
Define instructions' parameter format
-rw-r--r--cpu/instructions/parameter.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/cpu/instructions/parameter.txt b/cpu/instructions/parameter.txt
new file mode 100644
index 0000000..c68edd1
--- /dev/null
+++ b/cpu/instructions/parameter.txt
@@ -0,0 +1,31 @@
+n: min number of bits to be able to represent all types
+TODO: define x
+
+Binary format:
+ type[n], data[x]
+
+
+Types:
+ Short immediate reference:
+ Value is placed directly in the data section
+
+ Immediate reference:
+ y: min size required to represent each power of two value less than or equal to the current mode (in bytes, and greater than or equal to 1)
+ data[0 to x-y-1]:
+ size of immediate value
+
+ data[x-y to x-1]:
+ byte offset into the array of immediate values
+
+ Register:
+ data just to select which register
+
+ Memory at immediate reference:
+ Uses RAM pointed to by the value as obtained in `immediate reference` above
+
+ Memory at register:
+ Uses RAM pointed to by the value as obtained in `register` above
+
+ TODO: Will add more later
+
+All memory references go through any configured translation thereof, unless specified otherwise