diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/stage.h | 6 | ||||
-rw-r--r-- | inc/wb.h | 20 |
2 files changed, 25 insertions, 1 deletions
diff --git a/inc/stage.h b/inc/stage.h index 2f9812f..87ee9c1 100644 --- a/inc/stage.h +++ b/inc/stage.h @@ -81,6 +81,12 @@ class Stage */ bool is_checked_out(signed int r); /** + * Stores `d` into the register indexed `v`. + * @param the register number. + * @param the value to store. + */ + void store_register(signed int v, signed int d); + /** * Returns the value of the register corresponding to `v`. * @param the register number. * @return the value in the associated register. @@ -14,9 +14,27 @@ class WB : public Stage */ WB(Stage *next); using Stage::advance; - + private: void advance_helper() override; + /** + * Performs the actual work of storing into a register. + */ + void write_handler(); + /** + * Performs the actual work of processing a jump instruction. + */ + void jump_handler(); + /** + * @return true if the current instruction is an R or I type and is not a + * STORE. + */ + bool should_write(); + /** + * @return true if the current instruction is a J type and is not a push. + * STORE. + */ + bool should_jump(); }; #endif /* WB_H_INCLUDED */ |