Disassembler
--disassemble (src/disassembler.cpp) turns a compiled .bin file back into a readable instruction listing. It’s read-only — it cannot be combined with --compile or --run.
lumen program.lmn --compile --dbgsym
lumen program.lmn.bin --disassemble
Reading the output
===== Main =====
0x00000000: 03 01 00 | PUSH 'hello'
0x00000003: 02 00 | POP i
0x00000005: 03 03 00 | PUSH i
...
===== Routine show =====
0x0000004a: 04 01 | EXEC println
...
Each line shows:
- The bytecode offset, in hex — this is the address you’d use with the debugger’s
breakpointorpccommands. - The raw operand bytes for that instruction.
- The mnemonic (see Opcode Reference) and its decoded operand.
Routine bodies are appended after the main program stream, and — if debug symbols are loaded — the disassembler prints a ===== Routine <name> ===== header right before the offset where each one begins.
With and without debug symbols
If a matching <binary>.dbg file exists next to the file you’re disassembling, it’s loaded automatically (see Debug Symbols), and:
POP/PUSHoperands referencing variables show the variable’s original name instead of its slot index.CALLshows the target routine’s name instead of a bare offset.EXECshows the built-in function’s name (println,inputInt, …) instead of its numeric index.
Without a .dbg file, you still get a complete, correct listing — just with numbers where names would be.