summaryrefslogtreecommitdiff
path: root/src/mm.cc
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-22 23:39:14 -0400
committerbd <bdunahu@operationnull.com>2025-04-22 23:39:14 -0400
commit302bbdc7ac18cd355f9f081cae202f5434427262 (patch)
treea80693956999a39deece3130bbdee9a553babbb1 /src/mm.cc
parent74b24d15eb1fe48a8e221a0bc061107d6b85d659 (diff)
Use a struct for InstrDTO
Diffstat (limited to 'src/mm.cc')
-rw-r--r--src/mm.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mm.cc b/src/mm.cc
index 3df1578..ac77433 100644
--- a/src/mm.cc
+++ b/src/mm.cc
@@ -25,12 +25,13 @@ void MM::advance_helper()
signed int data;
int i;
- switch (this->curr_instr->get_mnemonic()) {
+ switch (this->curr_instr->mnemonic) {
case LOAD:
- i = this->storage->read_word(this, this->curr_instr->get_s1(), data);
+ i = this->storage->read_word(
+ this, this->curr_instr->operands.integer.slot_one, data);
this->status = i ? OK : STALLED;
if (this->status == OK) {
- this->curr_instr->set_s1(data);
+ this->curr_instr->operands.integer.slot_one = data;
} else
this->status = STALLED;
break;
@@ -38,7 +39,8 @@ void MM::advance_helper()
case PUSH:
case STORE:
i = this->storage->write_word(
- this, this->curr_instr->get_s2(), this->curr_instr->get_s1());
+ this, this->curr_instr->operands.integer.slot_two,
+ this->curr_instr->operands.integer.slot_one);
this->status = i ? OK : STALLED;
if (this->status != OK) {
this->status = STALLED;
@@ -46,10 +48,10 @@ void MM::advance_helper()
break;
case POP:
- i = this->storage->read_word(this, this->curr_instr->get_s3(), data);
+ i = this->storage->read_word(this, this->curr_instr->operands.integer.slot_three, data);
this->status = i ? OK : STALLED;
if (this->status == OK) {
- this->curr_instr->set_s3(data);
+ this->curr_instr->operands.integer.slot_three = data;
} else
this->status = STALLED;
break;