neon_vm · C compiled to WebAssembly

A bytecode VM, one instruction at a time

The program below is assembled into a real Chunk and executed by the VM's own vmStep() from src/vm.c. Nothing on this page interprets bytecode in JavaScript.

Program

One instruction per line: CONSTANT <number>, ADD, SUBTRACT, MULTIPLY, DIVIDE, RETURN, or BYTE <0-255> for raw bytes. Ctrl+Enter assembles.

Execution

assemble a program to begin

0ip (byte)
0stack depth
0steps

Stack

Disassembly

    Bytecode

    Constant pool

    The expression compiler is a small shunting-yard parser in app.js, added for this page. neon_vm itself has no compiler; it only executes bytecode. The error presets are the malformed programs its bounds checks exist to stop.