mc6809-core
mc6809-core is a small, focused Rust library implementing the Motorola 6809 CPU for use in emulators, tools, and testing harnesses. It provides a Cpu implementation capable of executing 6809 instructions against any memory system that implements the Bus trait.
Features
- Accurate 6809 instruction execution and addressing modes
- Modular design: separate
alu,addressing,bus,registersmodules - A
Bustrait for pluggable memory and I/O backends - Lightweight API suitable for embedding in emulators, disassemblers, and debuggers
Public modules
addressing— addressing mode helpersalu— arithmetic and logic operationsbus—Bustrait for memory accessregisters— CPU register and status types
Quick example
use ;
;
let mut bus = FlatRam;
// Place a reset vector pointing to 0x0400
bus.0 = 0x04;
bus.0 = 0x00;
// Place a NOP at 0x0400
bus.0 = 0x12;
let mut cpu = new;
cpu.reset;
assert_eq!;
cpu.step;
assert_eq!;
Building and testing
- Build:
cargo build(run in the workspace or this crate) - Test:
cargo test
Contributing
- Contributions, bug reports and improvements are welcome — open an issue or pull request in the main repository.