Skip to content

Motorola 6809

Motorola's 8-bit processor with 16-bit habits

Motorola's successor to the 6800, designed by Terry Ritter and Joel Boney after a study of 25,000 lines of 6800 code and on sale from 1979. Two accumulators that join into a 16-bit D, four 16-bit index and stack registers, a movable direct page, hardware multiply and addressing built for position-independent code. It ran the Dragon, the Tandy Color Computer, the Vectrex, Fujitsu's FM-7 and Williams' Defender and Robotron.

In January 1979 BYTE gave its opening pages to two engineers from Motorola’s plant in Austin, Texas, and let them make a large claim. “In this 3 part series,” wrote Terry Ritter and Joel Boney, “we will describe the design of what we feel is the best 8 bit machine so far made by human: the Motorola M6809.” The chip was not yet on sale. BYTE expected it “in the next few months”.

The 6809 was Motorola’s successor to its own 6800. It kept to 8-bit data but added the 16-bit registers, stacks and addressing modes that programmers of the 6800 and 6502 had to fake in software. It never matched the 6502 or Z80 in sales, but it found a home in some well-known machines: the Dragon 32, the Tandy Color Computer, the Vectrex, Fujitsu’s FM-7 and the Williams arcade boards behind Defender, Robotron: 2084 and Joust.

Fast facts

  • Designers: Terry Ritter and Joel Boney, Motorola, Austin.
  • On sale: 1979. BYTE expected it “in the next few months” in January 1979, and Southwest Technical Products was advertising a 6809 processor card by May.
  • Data and address buses: 8-bit data, 16-bit address (64K).
  • Registers: accumulators A and B, joined as the 16-bit D; index registers X and Y; stack pointers U and S; program counter; 8-bit direct page (DP) and condition code (CC) registers.
  • Byte order: big-endian. A 16-bit value is stored high byte first, the reverse of the 6502.
  • Multiply: MUL, unsigned 8×8 bits into the 16-bit D.
  • Speed grades: 1.0 MHz (6809), 1.5 MHz (68A09) and 2.0 MHz (68B09).
  • Versions: the MC6809 with its own clock oscillator, and the MC6809E, driven by an external clock.

Designed from the 6800’s code

Ritter and Boney’s account in BYTE is unusual for its detail. The project’s “principal public goal”, they wrote, “was to upgrade the 6800 processor to be definitely superior to the 8 bit competition”. Many people, customers among them, thought it needed little more than a second index register, a few instructions to go with it and some missing push and pull instructions. Since that would mean “a rather complete redesign anyway”, the designers went further.

They started by counting. A static analysis of 25,000 lines of existing 6800 code showed that loads and stores made up over 38 per cent of all instructions, followed by subroutine calls and returns at 13 per cent. Arithmetic came far down the list. So the designers spent their effort on moving data and passing parameters: more addressing modes, 16-bit loads and stores, and a second stack. The 6800 code also showed programmers avoiding instructions that worked on one accumulator but not the other. “Consistency became the battle cry of the M6809 designers!”

They then took a draft specification to about 30 customers, including some “known to be hostile to the 6800”. Most of them, the designers reported, “felt that an 8 bit architecture was adequate” and did not want to pay extra for a 16-bit one, as long as the new chip handled the common 16-bit operations. That is the 6809’s design: an 8-bit processor with 16-bit habits.

Ritter had another connection to the home computers that later used the chip. BYTE notes that he was also co-architect of the 6847 video display generator, the chip that draws the picture in the Dragon and the Color Computer.

The registers

Register Size Purpose
A, B 8-bit Accumulators
D 16-bit A and B joined, A as the high byte
X, Y 16-bit Index registers
U 16-bit User stack pointer, controlled only by the program
S 16-bit Hardware stack pointer, used for calls and interrupts
DP 8-bit Direct page: the high byte for direct addressing
CC 8-bit Condition codes: E F H I N Z V C
PC 16-bit Program counter

Two accumulators that make one. A and B are ordinary 8-bit accumulators, but loads, stores, adds, subtracts and compares also work on the pair as the 16-bit D. MUL multiplies A by B and leaves the 16-bit product in D. On a 6502 each of those operations is a sequence of byte-sized steps.

Two stacks. S is the processor’s own stack, used for subroutine returns and interrupts. U belongs to the program, which can use it to pass parameters or hold local data without disturbing return addresses. Both are full 16-bit pointers and can be anywhere in memory; the 6502’s stack is fixed at page one. The push and pull instructions take a mask, so one instruction can save “all, some, or none of the processor registers”.

A direct page that moves. On the 6800 and 6502, the short and fast “direct” or zero-page addressing mode reaches only the first 256 bytes of memory. The 6809 keeps the mode but takes the high byte of the address from DP, so the fast page can be any 256 bytes in memory. The register starts at zero on reset, which keeps the 6800 behaviour until a program changes it.

Indexing on every register. Indexed addressing works from X, Y, U, S or the program counter. The offset can be zero, a constant of 5, 8 or 16 bits, or an accumulator, and the register can step up or down by one or two automatically. Most of these modes can also be made indirect, so that the instruction reads the address it needs from memory before using it.

Interrupts at two speeds. An ordinary interrupt (IRQ) saves every register on the stack. The fast interrupt (FIRQ) saves only the program counter and condition codes, and the handler saves whatever else it uses. The E flag in the stacked condition codes records which kind happened, so the return instruction knows how much to restore. SYNC and CWAI halt the processor until an interrupt arrives.

Code that runs anywhere

Ritter and Boney called position-independent code “one of the highest priority design goals”. Code written that way runs unchanged wherever it is loaded, which matters for ROMs, cartridges and programs loaded by an operating system. The 6809 provides the means: branches with a 16-bit offset that reach the whole address space, program-counter relative addressing for data, and LEA (load effective address) to put the address of a table into a register.

Assembly
        LEAX    table,PCR    ; X = address of table, wherever this code is
        LDA     count,PCR    ; read a variable relative to the program counter
        LBRA    handler      ; branch with a 16-bit offset

Motorola’s 1981 programming manual states the rule in capitals, “NEVER USE ABSOLUTE ADDRESSING”, and gives the cost: position-independent code “is usually 5 to 10% slower than normal code”. Position-independent code covers the technique and its history in full, including its part in the OS-9 operating system that Fujitsu, among others, offered for its 6809 machines.

The machines

Two clocks. Ritter and Boney explained in BYTE that the chip would come in two versions: one with its own clock for small systems, and one driven from an external clock. The second, the 6809E, is the one found in machines where the processor has to keep in step with the video hardware.

  • Tandy TRS-80 Color Computer. Radio Shack’s technical manual calls the 6809E “one of the most powerful 8-bit microprocessors available”. Its clocks come from the MC6883 SAM (synchronous address multiplexer), which shares memory between the processor and the 6847 video chip, at 0.89 MHz.
  • Dragon 32 and 64 (1982). Dragon Data’s machine used the same 6809E, the same SAM and video chip, and the same Microsoft BASIC as the Color Computer. The authors of Inside the Dragon told readers that much of their book applied to the Tandy machine as well. The Dragon’s launch advertisement made the processor a selling point: “Pet, Apple, Atari 400, BBC Micro, and VIC 20 still have the less powerful 6502.” A later history, Imagine Publishing’s Videogames Hardware Handbook, argues that the same individuality clipped the Dragon’s wings: British software houses held back from the machine because their programmers had little or no experience of the 6809.
  • Vectrex (1982). GCE’s service manual names the processor of its vector-display console as the 68A09, the 1.5 MHz grade of the chip.
  • Fujitsu FM-7. BYTE reported from Japan in 1983 that “Fujitsu is fond of the 6809”, and that the FM-7, then said to be the second-best-selling computer in Japan, had a 68B09 alongside a Z80A. Fujitsu also offered OS-9 and FLEX for its 6809 machines.
  • Williams arcade games. The board behind Defender and Stargate has a 6809E as its main processor, at 1 MHz. Later games on the same design, among them Robotron, Joust and Sinistar, added Williams’ own blitter chips to move graphics, a job the 6809 did alone in Defender.

Sources

  • BYTE, January 1978, p.168: Carl Helmers, “The Motorola 6809: Some Rumors from Austin”.
  • BYTE, August 1978, p.54: the 6809 “due for formal product release later this year”.
  • BYTE, January 1979, pp.4 and 14-34: the issue introduction, and Terry Ritter and Joel Boney, “A Microprocessor for the Revolution: The 6809, Part 1: Design Philosophy”. The design goals, the analysis of 25,000 lines of 6800 code, the customer visits, the priority given to position-independent code (p.34), and the authors’ roles, including Ritter’s work on the 6847.
  • BYTE, March 1979: Ritter and Boney, Part 3, on the two clock versions.
  • BYTE, April 1979, “BYTE’s Bits”: the instruction set summary card supplied with the 6809.
  • BYTE, May 1979: Southwest Technical Products advertisement for its MP-09 processor card and 68/09 computer.
  • BYTE, September 1983, p.254: Fujitsu’s FM-7 and FM-11, the 68B09, and OS-9, FLEX and UCSD Pascal for the 6809.
  • Motorola, MC6809-MC6809E 8-Bit Microprocessor Programming Manual, 1981: §1.2-1.10 (registers, direct page, stack pointers, condition codes), §2.2 (addressing modes), §3.1-3.4 (interrupts), §4.1.1 and §4.2.2 (position-independent code), Appendix A (MUL, PULU, SYNC, CWAI).
  • Motorola, MC6809E HMOS 8-Bit Microprocessor data sheet, 1984: the 1.0, 1.5 and 2.0 MHz speed grades.
  • Radio Shack, TRS-80 Color Computer Technical Reference Manual, 1981: the 6809E and its clocks from the SAM.
  • Duncan Smeed and Ian Sommerville, Inside the Dragon (Addison-Wesley, 1983), preface and chapter 1: the Dragon’s 6809E, and the processor and BASIC it shares with the Color Computer.
  • Your Computer, August 1982: Dragon 32 launch advertisement.
  • General Consumer Electronics, Vectrex Service Manual, 1982, theory of operation: the 68A09.
  • Videogames Hardware Handbook Volume 1 (Imagine Publishing, second edition, 2016), Dragon 32 chapter: the 6809 as a reason for British software houses’ reluctance.
  • MAME source code, src/mame/williams/williams.cpp: the Williams 6809 boards, their clock, and which games have a blitter (web, secondary). https://github.com/mamedev/mame/blob/master/src/mame/williams/williams.cpp

See also

Checked. Verified against primary sources and signed off by a person.