summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/ex.h5
-rw-r--r--inc/instrDTO.h6
-rw-r--r--inc/stage.h20
3 files changed, 5 insertions, 26 deletions
diff --git a/inc/ex.h b/inc/ex.h
index 58237ab..5a5c046 100644
--- a/inc/ex.h
+++ b/inc/ex.h
@@ -76,11 +76,6 @@ class EX : public Stage
* @param if the modulo operator should instead be used
*/
void handle_divide(signed int &s1, signed int s2, bool is_mod);
- /**
- * Maps each mnemonic to a function which carries out the instruction's base
- * logic.
- * All instructions store the result into s1.
- */
};
#endif /* EX_H_INCLUDED */
diff --git a/inc/instrDTO.h b/inc/instrDTO.h
index 8f8e28e..b99ba20 100644
--- a/inc/instrDTO.h
+++ b/inc/instrDTO.h
@@ -43,10 +43,14 @@ struct InstrDTO {
*/
signed int slot_A;
/**
- * Optional slot for holding PC
+ * Optional slot for holding PC / base address
*/
signed int slot_B;
/**
+ * Optional slot to hold immediates
+ */
+ signed int slot_C;
+ /**
* The mnemonic of the instruction.
*/
Mnemonic mnemonic;
diff --git a/inc/stage.h b/inc/stage.h
index ae01723..dde103b 100644
--- a/inc/stage.h
+++ b/inc/stage.h
@@ -110,16 +110,6 @@ class Stage
template <typename T>
void store_register(signed int v, T d)
{
- // if (v < 0 || v >= GPR_NUM + V_NUM) {
- // throw std::out_of_range(
- // "instruction tried to access register which does not exist");
- // }
-
- // if (v >= GPR_NUM)
- // this->vrs[v % GPR_NUM] = d;
- // else
- // this->gprs[v] = d;
-
if constexpr (std::is_same_v<T, signed int>) {
if (v < 0 || v >= GPR_NUM) {
throw std::out_of_range("Invalid GPR index for storing scalar");
@@ -141,16 +131,6 @@ class Stage
template <typename T>
T dereference_register(signed int v)
{
- // signed int r;
-
- // if (v < 0 || v >= GPR_NUM + V_NUM) {
- // throw std::out_of_range(
- // "instruction tried to access register which does not exist");
- // }
-
- // r = (v >= GPR_NUM) ? this->vrs[v % GPR_NUM] : this->gprs[v];
- // return r;
-
if constexpr (std::is_same_v<T, signed int>) {
if (v < 0 || v >= GPR_NUM) {
throw std::out_of_range("Invalid GPR index");