Expand description
Bytecode disassembler — readable text for the Studio debug drawer and any
future largo --disasm. Pure, headless, no VM state.
Bytecode disassembler — renders a CompiledProgram’s Op stream as readable
text for the debugger (status line, bytecode tape) and any future
largo --disasm. Common ops get a clean infix form (constants resolved,
registers as R{n}, jump targets inline); the long tail falls back to the
Op Debug form, so a newly added op is never a panic — just a plainer line.
Structs§
- Disasm
Line - One disassembled instruction.
- OpIo
- The registers an op reads (its sources) and the one it writes (its destination). Drives the debugger’s datapath animation — which register cells light up, flow into the engine, and receive the result — and the plain-English narration. Empty for the long-tail ops (no animation/narration), which fall back to the disassembly text.
Functions§
- disassemble
- Disassemble every instruction in
prog.code(Main first, then the function bodies, which share the onecodevector). - format_
constant - The constant at
idx, formatted for narration (e.g.6,"hi",nothing). - format_
op - Render one instruction. Registers print as
R{n}; constants and global names are resolved againstprog. - op_io
- Compute the
OpIoof a bytecode op. - op_
targets - Absolute control-transfer targets of an op (for tape arrows / reachability).