From 16b6b9549cd2f5ce490f1b88ad4c7eff0b5180cd Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Sat, 6 Jun 2026 17:49:49 +0200 Subject: [PATCH] feat(furvm): add push byte as int instruction --- furvm/include/furvm/instruction.hpp | 7 +++++++ furvm/src/main.cpp | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/furvm/include/furvm/instruction.hpp b/furvm/include/furvm/instruction.hpp index 9a832d7..c0a524f 100644 --- a/furvm/include/furvm/instruction.hpp +++ b/furvm/include/furvm/instruction.hpp @@ -11,6 +11,13 @@ enum class instruction_t : byte { */ NoOperation = 0, + /** + * @brief Pushes an integer from a byte onto the stack. + * + * Pushes an integer constructed from a next byte onto the stack. + */ + PushB2I, + /** * @brief Pushes a constant onto the stack. * diff --git a/furvm/src/main.cpp b/furvm/src/main.cpp index e6f849d..0ff8592 100644 --- a/furvm/src/main.cpp +++ b/furvm/src/main.cpp @@ -6,7 +6,9 @@ #include #include -static constexpr std::array s_bytecode = { +static constexpr std::array s_bytecode = { + furvm::byte(furvm::instruction_t::PushB2I), + 67, furvm::byte(furvm::instruction_t::Return), };