forked from KPGPMC/furlang
feat(furvm): add return instructions
This commit is contained in:
@@ -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 {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
#include <cstddef>
|
||||
|
||||
static constexpr std::array<furvm::byte, 1> s_bytecode = {
|
||||
furvm::byte(furvm::instruction_t::NoOperation),
|
||||
furvm::byte(furvm::instruction_t::Return),
|
||||
};
|
||||
|
||||
int main(void) {
|
||||
|
||||
Reference in New Issue
Block a user