summaryrefslogtreecommitdiff
path: root/src/mm.cc
diff options
context:
space:
mode:
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;