From fd9a62701e4048ac6004052471d58f6383597fa0 Mon Sep 17 00:00:00 2001 From: Test_User Date: Sat, 29 Apr 2023 17:26:41 -0400 Subject: Define instructions' parameter format --- cpu/instructions/parameter.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cpu/instructions/parameter.txt 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 -- cgit v1.2.3