From c6ec18aeb84fe6f59613f932f96c629191d18d3d Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Sat, 6 Jun 2026 17:43:35 +0200 Subject: [PATCH] feat(furvm): add return instructions --- furvm/include/furvm/instruction.hpp | 10 ++++++++++ furvm/src/main.cpp | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/furvm/include/furvm/instruction.hpp b/furvm/include/furvm/instruction.hpp index 2ca340f..9a832d7 100644 --- a/furvm/include/furvm/instruction.hpp +++ b/furvm/include/furvm/instruction.hpp @@ -27,6 +27,16 @@ enum class instruction_t : byte { * @brief Duplicates top element on the stack. */ Duplicate, + + /** + * @brief Pops the current call frame. + */ + Return, + + /** + * @brief Pops the current call frame and pushes the first element from the previous stack onto the new stack. + */ + ReturnValue, }; struct instruction { diff --git a/furvm/src/main.cpp b/furvm/src/main.cpp index b35caaa..e6f849d 100644 --- a/furvm/src/main.cpp +++ b/furvm/src/main.cpp @@ -7,7 +7,7 @@ #include static constexpr std::array s_bytecode = { - furvm::byte(furvm::instruction_t::NoOperation), + furvm::byte(furvm::instruction_t::Return), }; int main(void) {