Skip to content

elijahmathews/da65-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

da65-rs

Build Workflow Status BadgeLicense: MIT

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.

Features

  • 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.

Installation

From Source

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).

Usage

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.bin

For a full list of options and flags, use the help command:

da65-rs --help

Project Status

This 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.

Core Functionality (Complete ✅)

  • 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.

Future Enhancements 💡

  • 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 a cc65-rs suite.
  • Publish the crate to crates.io for easy installation.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

License

This project is licensed under the MIT License.

About

A modern, cross-platform 6502 disassembler written in Rust, with support for multiple CPU variants.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages