This is a 6809 emulator written in gForth. You can load a 6809 binary rom and run it or step through.
Interupt related instructions are not implemented (CWAI, RTI,SWI, SWI2, SWI3, SYNC).
It is not cycle accurate.
Status: Passes MC6809 CPU Test Suite by W. Schwotzer
I have written some instructions here.
Some things that make this emulator more challenging than Emu6502:
- Indirect addressing & the postbyte register bit assignments, Fig 16 page 17 of the datasheet
- Some opcodes are 2 bytes long (10xx and 11xx), which break the simple opcode table and opcode decoding mechanism implemented in Emu6502. Impacts: OPCODES2 & BIND2 + new logic for FETCH and DECODE
- Some instructions manipulate 16 bit values while other manipulate 8 bit values. Impacts low level words like >N which now needs a 16-bit version (>NW)
- Some instructions manipulate both 8 and 16 bit registers. Impacts is additional logic is needed in higher level words (like in TFR, EXG...)
- Flag handling (like overflow V or half-carry H) in Condition Code Register
- Books from the era have many uncorrected erratas (from wrong information about flags used in instructions to non-existant addressing modes!)
- Motorola 6809 datasheet
- The MC6809 CookBook (TAB BOOKS Inc)
- MO6809 - MC6809E Microprocessor Programming Manual
- 6809 ISA in Python from which I generated my instructions words templates
Tests suites: