From 7b3abbd51c91b51725a12d17fad6ecbfcdb19975 Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 28 Mar 2025 19:55:04 -0400 Subject: Move get_instr_fields, add all instruction mnemonics --- inc/instr.h | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'inc/instr.h') 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 +#include #include +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>> instr_map; + extern const std::map mnemonic_map; + extern const std::map> instr_map; // clang-format on } // namespace instr -- cgit v1.2.3