Skip to content

Basic I/O & Loop Control

These instructions manage standard input/output operations and flow control within the virtual machine. They handle data output to the console, user input reading, and loop execution management.

OpcodeArgumentsOperands (stack)Description
print-valPrints the top value of the stack to the console without a newline
println-valPrints the top value of the stack to the console with a newline
stdin-valReads a line from standard input, trims the trailing newline characters, and pushes the resulting string onto the stack
stdout-valPops the top value from the stack (must be a String) and prints it to the console without a newline
stdoutln-valPops the top value from the stack (must be a String) and prints it to the console followed by a newline
clear_screen--Clears the terminal screen and resets the cursor position to the top-left corner using ANSI escape codes (\x1B[2J\x1B[1H)
break-target_ipStops the loop and jumps to the specified target_ip
nop--Empty instructions (usually for placeholders or alignment)

Released under the Apache-2.0 License.