aboutsummaryrefslogtreecommitdiff
path: root/vm/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'vm/runtime.c')
-rw-r--r--vm/runtime.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/vm/runtime.c b/vm/runtime.c
index 0fbea05..ce8281a 100644
--- a/vm/runtime.c
+++ b/vm/runtime.c
@@ -68,10 +68,11 @@ err_t vm_execute(vm_t *vm)
return PUSH_ROUTINES[instruction.opcode](vm, instruction.operand);
}
else if (OPCODE_IS_TYPE(instruction.opcode, OP_MOV) ||
- OPCODE_IS_TYPE(instruction.opcode, OP_PUSH_REGISTER))
+ OPCODE_IS_TYPE(instruction.opcode, OP_PUSH_REGISTER) ||
+ OPCODE_IS_TYPE(instruction.opcode, OP_DUP))
{
prog->ptr++;
- return REG_ROUTINES[instruction.opcode](vm, instruction.operand.as_byte);
+ return WORD_ROUTINES[instruction.opcode](vm, instruction.operand.as_word);
}
else if (OPCODE_IS_TYPE(instruction.opcode, OP_POP))
{
@@ -94,11 +95,6 @@ err_t vm_execute(vm_t *vm)
}
return ERR_OK;
}
- else if (OPCODE_IS_TYPE(instruction.opcode, OP_DUP))
- {
- prog->ptr++;
- return DUP_ROUTINES[instruction.opcode](vm, instruction.operand.as_word);
- }
else if (OPCODE_IS_TYPE(instruction.opcode, OP_NOT) ||
OPCODE_IS_TYPE(instruction.opcode, OP_OR) ||
OPCODE_IS_TYPE(instruction.opcode, OP_AND) ||