fantasm

fantasm

The Fantastic (dis-/re-)Assembly tools for 6502 code.

fantasm is a Python library and CLI for working with annotated 6502 disassemblies. It consumes the JSON / ASM / driver-script artefacts a disassembly run produces — typically from dasmos or py8dis, but fantasm only sees the output and stays disassembler-agnostic — and exposes them through a coherent set of sub-commands: round-trip verification, annotation linting, basic-block and call-graph analysis, cross-version annotation diffing, opcode-level address mapping between versions, and propagation of annotations along a project’s version DAG.

It is the consolidation of the per-project disasm_tools/ packages that used to live in acorn-nfs, acorn-adfs, acorn-econet-bridge and acorn-6502-tube-client; the four siblings now depend on fantasm and the duplication is gone.

Where to start

  • Brand new to fantasm? Read Getting started. It walks through the first hour: install, fantasm project init, dropping in a disassembly driver script, running the first disassemble / verify / lint cycle.

  • Disassembling a disc-loaded program, or adopting a project with its own layout? See Disassembling a disc-loaded program.

  • Setting up a new project’s fantasm.toml ? See fantasm.toml reference for the full schema, then The version graph for the multi-version pieces ([[versions.entry]], parents, reloc_blocks).

  • Asking “how do I X?” Check Workflows — recipe-style pages keyed on common questions (find missing comments, port annotations between versions, locate shared code with another ROM, …).

  • Reaching for the CLI reference? CLI reference is an exhaustive command-by-command listing, generated from the same Click definitions the binary uses, so it never goes stale.

  • Calling fantasm from your own Python code? The API reference is the importable surface — every public symbol from fantasm.api.*.

Tutorial

Indices and tables