This commit is contained in:
Andre Wagner
2026-04-30 10:07:08 -05:00
parent b29f322035
commit ae9b84a814
2 changed files with 7 additions and 2 deletions

View File

@@ -28,7 +28,9 @@ After some additional development:
- [x] External interface
- [x] Code execution (except functions)
- [x] Functions
- [ ] Print stack
- [x] Print stack
- [ ] Assembler
After some additional development:
- [ ] Bytecode loader

View File

@@ -58,9 +58,12 @@ void VM::step()
case Instruction::Sum:
stack_.push(binary_operation(stack_.pop(), stack_.pop(), BinaryOperationType::Sum));
break;
case Instruction::Return:
case Instruction::Return: {
Value v = stack_.pop();
stack_.pop_fp();
stack_.push(v);
return;
}
default:
throw VMInvalidOpcode((uint8_t) op.instruction);
}