From 6557e7e623140871968776429d241570002a65f5 Mon Sep 17 00:00:00 2001 From: bd Date: Sun, 30 Mar 2025 12:33:25 -0400 Subject: Setting condition code register, overflow guard --- inc/ex.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc/ex.h') diff --git a/inc/ex.h b/inc/ex.h index 2ca8876..4edf873 100644 --- a/inc/ex.h +++ b/inc/ex.h @@ -3,6 +3,7 @@ #include "instrDTO.h" #include "response.h" #include "stage.h" +#include 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> + instr_map; }; #endif /* EX_H_INCLUDED */ -- cgit v1.2.3