feat(furvm): add return instructions

This commit is contained in:
2026-06-06 17:43:35 +02:00
parent 4895489511
commit c6ec18aeb8
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -27,6 +27,16 @@ enum class instruction_t : byte {
* @brief Duplicates top element on the stack. * @brief Duplicates top element on the stack.
*/ */
Duplicate, 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 { struct instruction {
+1 -1
View File
@@ -7,7 +7,7 @@
#include <cstddef> #include <cstddef>
static constexpr std::array<furvm::byte, 1> s_bytecode = { static constexpr std::array<furvm::byte, 1> s_bytecode = {
furvm::byte(furvm::instruction_t::NoOperation), furvm::byte(furvm::instruction_t::Return),
}; };
int main(void) { int main(void) {