Dasmos
From Ancient Greek δασμός (dasmós, “division”), from δαίω (daíō, “to divide, share”).
An extensible tracing disassembler for classic-CPU ROMs, with first-class support for the 6502 and the BBC Micro / Master family.
Dasmos has two surfaces. The command line runs the whole pipeline against a binary in one shot — useful for triage, sanity checks, and CI wiring. The driver-script API is where serious analysis lives: a Python script declares labels, subroutines, comments, data classifications, and cross-references, and re-running the script regenerates the listing as the analysis evolves.
The CLI’s dasmos init command bridges the two — it scaffolds a
runnable starter driver from the same options you’d pass to
dasmos disassemble.
Lineage and acknowledgements
Dasmos is a ground-up rewrite and reimagining of a heavily modified fork of py8dis — Steven Flintham’s original programmable tracing disassembler for the 6502 family. Dasmos owes the whole core idea to Steven and to the py8dis project; this project organises a tracing disassembler as a core algorithm customised through plug-in extensions which provide knowledge of CPUs, different assembly syntaxes, and target environments. The core of the essential design vocabulary — driver scripts, traced classification, label / comment / banner annotations — is all inspired by py8dis.
Driver scripts written for py8dis can be ported automatically to
Dasmos with the bundled scripts/py8dis2dasmos.py.
Contents
- Command-line reference
- Driver-script API
- The minimal driver
- Building the disassembler
- Seeding the trace
- Naming things: labels and constants
- Assembler-neutral expressions
- Indexed-base addresses and regions
- Marking subroutines
- Comments
- Top-of-file preamble: header and build instructions
- Load-and-run programs (exec / reload addresses)
- Classifying data
- Automatic string detection
- Operand format hints
- Putting it together: a fuller driver
- Switching renderers
- Hooking subroutines
- Where to go next
- Cookbook: expressions and macros
- Recipe 1: an operand plus a constant
- Recipe 2: the low byte of a label, minus one
- Recipe 3: a masked difference of two labels
- Recipe 4: forcing radix and character literals
- Recipe 5: string operations — keep the meaning visible
- Recipe 6: lift a repeated expression into a macro
- All the operators
- How it renders correctly everywhere
- Reaching further
- Cookbook: adopting
index_base/index_region - API reference
- Top-level package
- The Disassembler
- Intermediate representation
- Annotations: comments and banners
- Format hints: renderer-agnostic operand-format intent
- Expressions: the assembler-neutral DSL
- Output: text and structured
- CPU extension point
- Renderer extension point
- Environment extension point
- Extension base
- Exceptions