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/stage.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc/stage.h') diff --git a/inc/stage.h b/inc/stage.h index 50c413a..c0dc6a8 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -9,6 +9,13 @@ #include #include +enum CC { + GT, + EQ, + UF, + OF, +}; + class Stage { public: @@ -30,6 +37,17 @@ class Stage virtual InstrDTO *advance(Response p) = 0; protected: + /** + * Sets the bit in the condition code register corresponding to `c`. + * @param the condition code to set. + * @param the truthy value to set it to. + */ + void set_condition(CC c, bool v); + /** + * Gets the bit in the condition code register correspondng to `c`. + * @param the condition code to retrieve, + */ + bool get_condition(CC c); /** * Helper for `check_out`. * Returns true if r are not checked out, false otherwise. -- cgit v1.2.3