From ae9b84a8145ed740f0ca5bbf1c14d2d41f92d14e Mon Sep 17 00:00:00 2001 From: Andre Wagner Date: Thu, 30 Apr 2026 10:07:08 -0500 Subject: [PATCH] . --- TODO.md | 4 +++- src/vm/vm.cc | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TODO.md b/TODO.md index 842b83a..fedadc1 100644 --- a/TODO.md +++ b/TODO.md @@ -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 diff --git a/src/vm/vm.cc b/src/vm/vm.cc index a6b0e5b..61d0971 100644 --- a/src/vm/vm.cc +++ b/src/vm/vm.cc @@ -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); }