summaryrefslogtreecommitdiff
path: root/inc/instr.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/instr.h')
-rw-r--r--inc/instr.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/inc/instr.h b/inc/instr.h
new file mode 100644
index 0000000..08b4fd0
--- /dev/null
+++ b/inc/instr.h
@@ -0,0 +1,56 @@
+#ifndef INSTR_H
+#define INSTR_H
+#include <functional>
+#include <iostream>
+#include <unordered_map>
+
+enum Mnemonic {
+ ADD,
+ SUB,
+ MUL,
+ QUOT,
+ REM,
+ SFTR,
+ SFTL,
+ AND,
+ OR,
+ NOT,
+ XOR,
+ ADDV,
+ SUBV,
+ MULV,
+ DIVV,
+ CMP,
+ CEV,
+ LOAD,
+ LOADV,
+ ADDI,
+ SUBI,
+ SFTRI,
+ SFTLI,
+ ANDI,
+ ORI,
+ XORI,
+ STORE,
+ STOREV,
+ JMP,
+ JRL,
+ JAL,
+ BEQ,
+ BGT,
+ BUF,
+ BOF,
+ PUSH,
+ POP,
+ NOP,
+};
+
+namespace instr
+{
+// clang-format off
+ extern const std::unordered_map<unsigned int, Mnemonic> mnemonic_map;
+ extern const std::unordered_map<Mnemonic, std::function<void(signed int &s1, signed int &s2, signed int &s3)>> instr_map;
+// clang-format on
+} // namespace instr
+
+#endif /* INSTR_H_INCLUDED */