Skip to content

Control Flow & Function

These instructions manage the execution flow of the virtual machine, including branching, function scoping, and process termination. Note: Functions in LightVM operate within an isolated scope; local variables defined within a func block are destroyed upon the return instruction to ensure memory efficiency.

OpcodeArgumentsOperands (stack)Description
jumptarget_ip-Jump to a specific instruction line (Instruction Pointer)
if_falsetarget_ipcondJump if the value on the stack is false
funcname, argc, start, end, [params]-Function block definition (scope)
callname, argc-Call a function with a specified number of arguments
return-valExit the function and return to the caller
stop--Kill all VM processes (Halt)

Released under the Apache-2.0 License.