Cycle Accurate Motorola 6809 Microprocessor, Verilog

A love letter to a very special sliver of silicon.


As teenagers in the 1980s, Greg Miller and I wrote countless lines of assembly-language code for the Motorola 6809 microprocessor. Often considered the best (certainly the most fun) of the 8-bit micros, it failed to achieve the widespread success of the MOS 6502 and Zilog Z80.

The 6809 arrived at an awkward time for both manufacturing process and the industry as a whole. Motorola couldn’t get the price down and had a next-generation 16 bit processor waiting in the wings.

Many theories exist for the 6809’s underperformance in the marketplace. Cost was an issue but nobody could get their head around the thing, including Motorola themselves.

They sure tried. Motorola not only made the 6809 source code compatible with other chips, they supported relocatable object code, hoping to sell ROMs full of prefabricated subroutines.

Fifty years later, the 6809 still seems to have just a few more features than people can comfortably fit into their head. Open source projects, emulators, even basic tutorials frequently stall around 90% complete. There are at least ten emulators and a half dozen operating systems for this modest chip yet I couldn’t find a modern cross assembler that could generate accurate binaries from 1980s source. One actually took longer to assemble code on a modern machine than a vintage one took to assemble code off floppy disks in 1987.

After submitting patches to an open source assembler, making modifications to the 6809 core in MAME, and releasing source code to an app that Greg Miller and I wrote in the 1980s, I noticed that the retro-computing crowd was moving toward FPGA emulation.

Being able to assemble code accurately doesn’t mean much if nobody can run it. And despite the 6809 being used in several of the top video games of all time (a common motivator in the emulation crowd) nobody was stepping up.

So Greg and I decided to get the band back together.

The result is a pin and cycle accurate 6809 and 6809E CPU core built from the data sheets up. Verified with a logic analyzer, exhaustive tests against known good emulators, and via circuit compatibility in the actual CPU socket of vintage computers and arcade games. (The validation page is a fun read.)

Verilog 6809 on a GODIL in a Vectrex

Greg did the heavy lifting on this one and I served mostly as project manager. Although I did get to write a patch for a decades-old glitch in Williams’ Stargate.

Released as open source with a permissive license, it’s the standard core now used in emulators and even industrial applications.

https://github.com/cavnex/mc6809


When you’ve got twenty minutes and really want to feel something, read this:
The Sixth Stage of Grief Is Retro-computing (Paul Ford, 2014)