summaryrefslogtreecommitdiff
path: root/inc/instr.h
diff options
context:
space:
mode:
Diffstat (limited to 'inc/instr.h')
-rw-r--r--inc/instr.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/inc/instr.h b/inc/instr.h
index ce08685..98ecf1d 100644
--- a/inc/instr.h
+++ b/inc/instr.h
@@ -1,13 +1,56 @@
#ifndef INSTR_H
#define INSTR_H
-
#include <functional>
+#include <iostream>
#include <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,
+};
+
+std::ostream &operator<<(std::ostream &os, Mnemonic a);
+
namespace instr
{
// clang-format off
-extern const std::map<int,std::map<int,std::function<void(signed int &s1, signed int &s2, signed int &s3)>>> instr_map;
+ extern const std::map<unsigned int, Mnemonic> mnemonic_map;
+ extern const std::map<Mnemonic, std::function<void(signed int &s1, signed int &s2, signed int &s3)>> instr_map;
// clang-format on
} // namespace instr