Motorola 6809
The Motorola 6809 is an 8-bit microprocessor with some 16-bit features. It was designed by Motorola's Terry Ritter and Joel Boney and introduced in 1978. Although source compatible with the earlier Motorola 6800, the 6809 offered significant improvements over it and 8-bit contemporaries like the MOS Technology 6502, including a hardware multiplication instruction, 16-bit arithmetic, system and user stack registers allowing re-entrant code, improved interrupts, position-independent code, and an orthogonal instruction set architecture with a comprehensive set of addressing modes.
The 6809 was among the most powerful 8-bit processors of its era. It was also among the most expensive; in 1981 single-unit quantities were compared to for a Zilog Z80 and for a 6502. It was launched when a new generation of 16-bit processors were coming to market, like the Intel 8086, and 32-bit designs were on the horizon, including Motorola's own 68000. It was not feature competitive with newer designs and not price competitive with older ones.
Usage
The 6809 is used in the TRS-80 Color Computer, Dragon 32/64, SuperPET, ENER 1000, Fujitsu FM-7, the Cybernex LC3, and Thomson MO/TO home computers, the Vectrex game console, and early 1980s arcade video games such as Star Wars and Gyruss. Also, Williams Electronics used the 6809 in arcade games such as Defender, Robotron: 2084, and Joust. In the 1990s, Williams introduced the WPC platform for the pinball machines the company was producing at the time. Series II of the Fairlight CMI digital audio workstation and Konami's Time Pilot '84 arcade game each use dual 6809 processors. Hitachi was a major user of the 6809 and later produced an updated version as the Hitachi 6309.History
6800 and 6502
The Motorola 6800 was designed beginning in 1971 and released in 1974. In overall design terms, it has a strong resemblance to other CPUs that were designed from the start as 8-bit designs, like the Intel 8080. It was initially fabricated using early NMOS logic, which normally required several different power supply voltages. A key feature was an on-chip voltage doubler that allowed it to run on a single supply, a major advantage over its competitors like the 8080 which required,, and.The 6800 was initially fabricated using the then-current contact lithography process. In this process, the photomask is placed in direct contact with the wafer, exposed, and then lifted off. There was a small chance that some of the etching material would be left on the photomask when it was lifted, causing future chips patterned with the mask to fail. For complex multi-patterned designs like a CPU, this led to about 90% of the chips failing when tested. To make a profit on the small number of chips that did work, the prices for the working models had to be fairly high, on the order of hundreds of dollars in small quantities.
Some of the 6800's designers were convinced that a lower-cost system would be key to widespread acceptance. Notable among them was Chuck Peddle, who was sent on sales trips and saw prospective customers repeatedly reject the design as being too expensive for their intended uses. He began a project to produce a much less costly design, but Motorola's management proved uninterested and eventually told him to stop working on it. Peddle and some other members of the 6800 team left Motorola for MOS Technology and introduced this design in 1975 as the MOS Technology 6502.
The 6800 was initially sold at in single-unit quantities, but had been lowered to. The 6502 was introduced at, and Motorola immediately reduced the 6800 to $125. It remained uncompetitive and sales prospects dimmed. The introduction of the Micralign to Motorola's lines allowed further reductions and by 1981 the price of the then-current 6800P was slightly less than the equivalent 6502, at least in single-unit quantities. By that point, however, the 6502 had sold tens of millions of units and the 6800 had been largely forgotten.
6809
While the 6502 began to take over the 6800's market, Intel was experiencing the same problem when the upstart Zilog Z80 began to steal sales from the Intel 8080. Intel did not consider this a major threat, as the 8080 had always been considered a bit of a "hack" and they were heavily invested in a new 32-bit design, the Intel iAPX 432. But as the Z80 began to seriously disrupt sales, and the 432 still some way in the future, Intel responded by quickly introducing a small but practical upgrade of the 8080 as the 8085, which made it less expensive to use and more competitive with the Z80. They also began to design a series of a 16-bit processor that was basically an enlarged 8085, which emerged as the Intel 8086 in 1978.Motorola had also began the design of a high-end design, in the MACSS project, a mixed 16/32-bit system. They did not initially consider an improved 8-bit design like the 8085, but when they polled their existing 6800 customers, they found that many were not willing to pay for a 16-bit design for their simple needs. This led to the decision to produce their own interim 8-bit design, offering major improvements but remaining compatible with earlier versions.
Analysis of 6800 code demonstrated that loads and stores were the vast majority of all the time in CPU terms, accounting for 39% of all the operations in the code they examined. In contrast, mathematical operations were relatively rare, only 2.8% of the code. However, a careful examination of the loads and stores noted that many of these were being combined with adds and subtracts, revealing that a significant amount of those math operations were being performed on 16-bit values. This led to the decision to include basic 16-bit mathematics in the new design: load, store, add, and subtract. Similarly, increments and decrements accounted for only 6.1% of the code, but these almost always occurred within loops where each one was performed many times. This led to the addition of post-incrementing and pre-decrementing modes using the index registers, which eliminated the need for the explicit INC or DEC instruction, saving memory and the time needed to read it.
Another major goal for the new design was to support position-independent code. Motorola's market was mostly embedded systems and similar single-purpose systems, which often ran programs that were very similar to those on other platforms. Development for these systems often took the form of collecting a series of pre-rolled subroutines and combining them together. However, as assembly language is generally written starting at a base address, combining pre-written modules normally required a lengthy process of changing constants that pointed to key locations in the code.
Motorola's idea was to eliminate this task and make the building-block concept much more practical. System integrators would simply combine off-the-shelf code in ROMs to handle common tasks. Libraries of common routines like floating point arithmetic, graphics primitives, Lempel-Ziv compression, and so forth would be available to license, combine together along with custom code, and burn to ROM.
In previous processor designs, including the 6800, there was a mix of ways to refer to memory locations. Some of these were relative to the current location in memory or to a value in an index register, while others were absolute, a 16-bit value that referred to a physical location in memory. The former style allows code to be moved because the address it references will move along with the code. The absolute locations do not; code that uses this style of addressing will have to be recompiled if it moves. To address this, the 6809 filled out its instruction opcodes so that there were more instances of relative addressing where possible.
As an example, the 6800 includes an 8-bit direct addressing mode used to make code smaller and faster; instead of a memory address having 16 bits and thus requiring two bytes to specify, commonly used variables could be located within a 256-byte window and accessed with an 8-bit address. The downside was competition for valuable direct page addresses. The 6809 added a new 8-bit DP register, allowing direct page addressing to refer to any part of memory as long as the DP register is changed to point to its new location.
A second category of data was constant data stored in ROM such as strings and lookup tables. To solve the problem of easily referring to such data while remaining position independent, the 6809 added a variety of new addressing modes. Among these was program-counter-relative addressing which allowed any memory location to be referred to by its location relative to the instruction. Moving this code to a new location in memory would have no effect on the addresses. Additionally, the stack was more widely used, so that a program in ROM could set aside a block of memory in RAM, set the SP to be the base of the block, and then refer to data within it using relative values.
To aid this type of access, the 6809 renamed the SP to U for "user", and added a second stack pointer, S, for "system". The idea was user programs would use U while the CPU itself would use S to store data during subroutine calls. This allowed system code to be easily called by changing S without affecting any other running program. For instance, a program calling a floating-point routine in ROM would place its data on the U stack and then call the routine, which could then perform the calculations using data on its own private stack pointed to by S, and then return, leaving the U stack untouched.
Another reason for the expanded stack access was to support reentrant code, code that can be called from various different programs concurrently without concern for coordination between them, or that can recursively call itself. This makes the construction of operating systems much easier; the operating system had its own stack, and the processor could quickly switch between a user application and the operating system simply by changing which stack pointer it was using. This also makes servicing interrupts much easier for the same reason. The 6809 adds a fast interrupt request interrupt that saves only the program counter and condition code register before calling the interrupt code, whereas the IRQ interrupt saves all registers, taking additional cycles, then more to unwind the stack on exit.
The 6809 included one of the earliest dedicated hardware multipliers. It takes 8-bit numbers in the A and B accumulators and produces a 16-bit result in A:B, known collectively as D.