diff options
author | bd <bdunahu@operationnull.com> | 2025-03-30 12:33:25 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-03-30 12:33:25 -0400 |
commit | 6557e7e623140871968776429d241570002a65f5 (patch) | |
tree | 420c2aced8e008708ea951edf36608e0bc5d4e2c /inc/ex.h | |
parent | 8e56373a5436852fe9c7934e03d7b57493625003 (diff) |
Setting condition code register, overflow guard
Diffstat (limited to 'inc/ex.h')
-rw-r--r-- | inc/ex.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -3,6 +3,7 @@ #include "instrDTO.h" #include "response.h" #include "stage.h" +#include <unordered_map> class EX : public Stage { @@ -15,6 +16,23 @@ class EX : public Stage EX(Stage *next); InstrDTO *advance(Response p) override; + + private: + /** + * Sets the (over|under)flow condition code if adding `a` and `b` results in + * either. + * @param the first operand + * @param the second operand + */ + void overflow_guard(signed int a, signed int b); + /** + * Maps each mnemonic to a function which carries out the instruction's base + * logic. + */ + std::unordered_map< + Mnemonic, + std::function<void(signed int &s1, signed int &s2)>> + instr_map; }; #endif /* EX_H_INCLUDED */ |