650Vue Part 2: The 6502 Microprocessor
The KIM-1's CPU is MOS Technology's 6502 microprocessor, so in order to build something like a virtual KIM-1, I would need to build a virtual 6502 to run it. Fortunately, I had already written a 6502 simulator in Ruby, so I didn't need to spend much time on my 6502 core; I was able to focus on the Vue framework surrounding the 6502.
MOS Technology's 6502 microprocessor was designed by a team of former Motorola engineers led by Chuck Peddle. Here's the thing: this same design team had previously worked on Motorola's 6800 chip. The 6502 was intended to compete againsst the 6800 as a simpler, faster, and cheaper alternative. There was even a version of the 6502, the 6501, that was socket-compatible with the 6800, to make it easy to replace the 6800 with the cheaper 6502. The early days of the microcomputer were cutthroat.
Naturally, there were lawsuits, and MOS Technology was "rescued" (bought out) by Commodore, a calculator company led by a man so cutthroat that he would eventually use the 6502 to fuel a price war that buried rival Texas Instruments in the home computer market. There's too much history to recount here, but if you're interested, I recommend reading up on Commodore founder Jack Tramiel.
The 6502 microprocessor was everywhere in the 1980s. A significant variant of the chip, the 6510, powered the Commodore 64, the best-selling home computer of all time. And because Commodore owned MOS Technology, they put the 6502 (or a variant) in all of their 8-bit computers, starting with the PET and CBM models of the 1970s, and moving on to the VIC-20, the 64 and the 64C, the 128 and the 128D, the 16, and the Plus/4, as well as a number of more obscure models and prototypes such as the 64GS, the Ultimax, the SX-64, and the 364. That's a lot of models. (Commodore's marketing was spectacularly unfocused, which is a big part of the reason the company is not around anymore.)
MOS Technology licensed the 6502 to other home computer manufacturers: Apple used the 6502 in the orginal Apple I kit (the one that the two Steves bodged together in a garage), the Apple ][ (Apple's first big commercial success), and put a Synertek clone of the 6502 in the Apple III (Apple's first big commercial failure); Atari used the 6502 in its 8-bit machines, including the 400, 800, and the XL and XE lines; in the UK, you could find the 6502 in machine lines such as Oric, the Acorn, and the BBC Micros.
Variants of the 6502 were also used in game consoles of the 1970s and 1980s. The Atari 2600 was built around the 6507, a 6502-derivative with some pins removed to cut costs. Figure 3 shows an Atari magazine ad from 1977. I love these vintage ads—look at how excited those stock models are! Notice, too, that two players are engaging separate joysticks in what is clearly a one-player game; I like to think that nobody bothered to tell Dad that he's not actually controlling anything, but he's having a good time anyway. The Nintendo Entertainment System was also built around a close relative of the 6502. The Nintendo ad in Figure 4 maintains the tradition of depicting two players pretending to control a one-player game. We can also observe that the Nintendo family doesn't have any girls in it, a detail which tells you a lot about the video game industry.
The 6502 is not a mere historical curiosity; it continues to find life in simple electronics such as the Tamagotchi "virtual pet", the toy that according to urban legend will cause airplanes to drop from the sky. The Furby is brought to life by a chip whose instruction set is a subset of the 6502's; if you can understand 6502 assembly language, you can understand Furby's source code. I've also heard (but have been unable to confirm) that the 6502 shows up in more serious machines such as thermostats and medical scanners.
Additionally, the 6502 will continue to be used in the distant future, serving as the brain of the Model 22 Bending Unit and the targeting system of the Cyberdyne Systems Model 101 (also known as the T-800 or Terminator). The 6502 has a long lifespan ahead of it.
In the next section, I'll look at the design of the KIM-1 computer and talk about how I adapted its architecture to fit a single-page application written in Vue.