A modern, fast, and robust disassembler for the 6502/65C02 microprocessor, written in Rust.
This project is a rewrite of the da65 utility from the venerable cc65 toolchain, with the goal of providing a dependency-free, cross-platform binary that is easy to use and integrate into modern development workflows.
- Smart Traversal: Uses a recursive traversal algorithm to intelligently separate code from data.
- Automatic Label Generation: Performs a multi-pass analysis to find and create labels for all jump, branch, and data targets.
- High Performance: Built with performance in mind to handle large binary files quickly.
- Modern CLI: User-friendly command-line interface with clear help and error messages.
- Cross-Platform: Compiles and runs on Windows, macOS, and Linux.
To build from the source code, clone the repository and use cargo to install it locally:
git clone https://github.com/elijahmathews/da65-rs.git
cd da65-rs
cargo install --path .This will build the executable and place it in your Cargo binary path (e.g. ~/.cargo/bin).
The basic usage involves providing an input binary file and its starting memory address.
# Disassemble a firmware ROM that loads at address $8000
da65-rs --load-addr 0x8000 firmware.binFor a full list of options and flags, use the help command:
da65-rs --helpThis project has a functional, intelligent disassembly engine that can successfully analyze 6502-family binaries. It accurately separates code from data and produces readable, labeled assembly output.
- Parse command-line arguments (clap), including CPU variant and load address.
- Read and process an input binary file.
- Define instruction sets for MOS 6502 and WDC 65C02S.
- Implement an iterative multi-pass analysis to identify all jump/branch and data targets.
- Implement a recursive traversal algorithm to accurately separate code from data.
- Generate assembler directives (
.setcpu,.byte,.word) and a file header. - Format branch/jump operands to use labels instead of raw addresses.
- Implement columnar alignment and redundant address suppression for clean output.
- Add support for "illegal" (undocumented) NMOS 6502 opcodes.
- Allow an input "info file" to provide user-defined labels and comments.
- Refactor the core logic into a library crate (
lib.rs) to be shared by other tools in acc65-rssuite. - Publish the crate to
crates.iofor easy installation.
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License.