summaryrefslogtreecommitdiff
path: root/src/cpu/table.h
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-07-27 11:36:01 +1000
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-07-27 11:36:01 +1000
commit9a6188f821b11b69fff3d3a303dbfcce2e52e6f4 (patch)
treeb06aa0d876b19cca281cbc26db9086ab7241d6bd /src/cpu/table.h
parentb158eaeb489bce502198e844593b38a2f5f5b9ee (diff)
refactoring of src/cpu/
Diffstat (limited to 'src/cpu/table.h')
-rw-r--r--src/cpu/table.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/cpu/table.h b/src/cpu/table.h
new file mode 100644
index 0000000..ded8d63
--- /dev/null
+++ b/src/cpu/table.h
@@ -0,0 +1,30 @@
+// table.h
+// Defines the instruction table, and the functions to access it.
+#ifndef TABLE_H
+#define TABLE_H
+
+#include"cstdint"
+#include"string"
+#include"addressing.h"
+
+void* InstructionTable;
+
+void (*func)(Addressing, address);
+
+#define InstructionTableSize (256 * (sizeof(uintptr_t) + sizeof(Addressing)))
+
+uintptr_t* getInstructionTableFunction(int i);
+
+Addressing* getInstructionTableAddressing(int i);
+
+void callInstructionTable(int i, address val);
+
+void setInstructionTable(int i, uintptr_t p, Addressing r);
+// Sets an individual portion of an instruction set
+
+void initInstructionTable();
+// Initializes entirety of the instruction table in memory.
+
+
+
+#endif \ No newline at end of file