diff options
Diffstat (limited to 'inc/ex.h')
-rw-r--r-- | inc/ex.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -3,6 +3,7 @@ #include "instrDTO.h" #include "response.h" #include "stage.h" +#include <unordered_map> class EX : public Stage { @@ -13,8 +14,19 @@ class EX : public Stage * @return A newly allocated EX object. */ EX(Stage *next); + using Stage::advance; - InstrDTO *advance(Response p) override; + private: + void advance_helper(); + /** + * Maps each mnemonic to a function which carries out the instruction's base + * logic. + * All instructions store the result into s1. + */ + std::unordered_map< + Mnemonic, + std::function<void(signed int &s1, signed int s2)>> + instr_map; }; #endif /* EX_H_INCLUDED */ |