Skip to main content

The MOS 6502: Chip used by everyone

(This chapter is still a work in progress)

Introduction: Are you Sarah Connor?​

"Even Terminator uses 6502" - Giovanni Giorgi

"The Terminator" Movie (1984) shows some 6502's code snippet on the screen, from time to time:

Credits: Michael Steil

MOS 6502 is a 8bit chip invented by Chuck Peddle and delivered to market in 1975. It is the chip used by Atari, Apple ][, BBC Micro, Commodore (Pet/Vic20/C64,C128) and Nintendo Entertainment System (NES). To understand it, it can be useful to look at Motorola 6800 which is the 'fatter' father of 6502.

The 6502 is a true orthogonal 8-bit system, with only three internal registers (A,X,Y) with different purposes, able only to do sums and subtractions (no fancy multiplication).

Most of the instructions take 2-3 cycle, with more cycles for the complex indirect instructions: 6502 delivered very high throughput, compared to other chips. It can address up to 65536 bytes (64KB) which was a lot for that time: in the Atari Chapter you discovered 128 bytes was enough for a small home console so its address space seems "huge" for the times.

As we shall see, one of the downside of the 6502 is the lack of a true way of addressing an indirect location inside its 16bit-space: you are unable to create a real "pointer", and you are limited only to 256 bytes offset from a "baseline" address. To overcome this limitation, self-modifying code was the norm, like the CHRGET routine in the C/64 BASIC V2.

A bit of history (WIP)​

At the beginning of 1974 Chuck Peddle worked for Motorola, and was trying to purse a chip for the microcontroller market. After failing, he joined to MOS Technology, a little integrated circuit manufacturer located near Valley Forge, Pennsylvania. There is a very long article with detail on this story by Jason Sachs 1:

For the most part, design of the 6502 was paper-and-pencil, with some computer-assisted aspects of layout. Peddle was project leader, and focused on the business aspects

The important things to note is the chip was made in a very budget-limited environment, manually tested by Chuck Peddle in person, and used a new manufactoring process (depletion-load NMOS process) which allowed MOS to achieve higher performance in a smaller die size.

We read from 1:

The 6502 was aimed to compete in price against the Intel 4040 in the microprocessor-based control systems market[46], but blew it >away in technical specs: the 4040 was a 4-bit processor with a slower maximum clock frequency and required a 15V supply. [..] Here the story takes one of those legendary turns. Steve Wozniak had been designing the Apple I around the Motorola 6800, but he sees the MOS Technology ad, realizes he can get a better price [...], goes to WESCON, and buys a couple of chips from Peddle[..]

The pocket calculator business was going to collapse, because of price drops, so MOS Technology was in trouble1:

MOS Technology was still looking for customers. In September 1976, it was purchased by Commodore, a calculator manufacturer, in a move that, to me, appears to be one of financial desperation… but it set the combined company on an arc that lasted the next 18 years as it crossed into personal computers. 1

6502 in the pop culture​

Michel Stein 2 has found a reference to the 6502 in "The Terminator" movie and he wrote an excellent article in 2009

References​


  1. Development of the MOS Technology 6502: A Historical Perspective https://www.embeddedrelated.com/showarticle/1453.php↩
  2. Michel Stein article on the Terminator hidden 6502 code: https://www.pagetable.com/?p=64↩