Skip to content

Stack & Variable Management

These instructions detail the core operations for stack manipulation and variable lifecycle management. They are fundamental to LightVM's stack-based architecture, governing how data is stored, retrieved, and organized during execution.

OpcodeArgumentsOperands (stack)Description
pushvalue-Inserting data into the stack
valname-Declaring a new variable
setnamevalTake the top stack and then save it to the variable name
getname-Take the contents of the name variable and push it onto the stack
dup-valDuplicate the top value in the stack
swap-val1, val2Swap the top stack with the bottom stack

Released under the Apache-2.0 License.