(Updated January 19, 2025)
Table of Contents
Starting Out With Old Tech
The tech we’re talking about here is the MOS 6502. Why choose an old CPU such as this? It’s a good place to begin since the CPU is so primitive that we can easily introduce people to its basic characteristics.
Since the number of operations on this CPU is relatively small compared to today’s CPUs, the body of knowledge is easier to grasp and far less overwhelming. Once we’ve ironed out the basics of programming the 6502, we’ll switch to solving larger problems that existed during that period. The 6502 has no multiplication or division instructions—it was up to the programmer to write those routines independently. So, we will explore what that was like. This will help us to develop our skills in bit manipulations, gain a deeper understanding of architecture, and understand the finer points of some of the math involved in making an 8-bit computer use large numbers.
What is interesting is the 6502 is this it’s still being manufactured today. Western Design Center manufactures the 6502 as the W65C02S. If you want to know more, you can read the datasheet available.
Once we’ve familiarized ourselves with the details of the 6502, we can transition to a more modern x86-64 architecture. Once we’ve laid the foundation, this shift in focus provides a clear perspective on the CPUs’ historical nature, highlighting what has changed and remained the same.
The MOS 6502
Ok, this will not rehash everything other people have said. Millions of pages in thousands of books have been written on this CPU. The better ones that are still available online are listed below. Feel free to peruse all that you like.
The MOS 6502 was a CPU from a family of CPUs created by former Motorola engineers. The 6502 gained huge fame from being in systems like the Apple II, Commodore VIC-20, and Commodore 64 (as the MOS 6510). It was also in the Atari 2600 (as the MOS 6507) and the original Nintendo Entertainment System or NES (as the Ricoh 2A03 or RP2A03).
Well, that’s a lot of names and numbers, but what does it all mean? So many devices ran on a similar architecture with a consistent instruction set and addressing modes. The market sought programmers who could write assembly language on this CPU.
While the Apple II debuted at roughly $1300 in 1977, the Commodore VIC-20 was about $300 in 1980.
The fact that the 6502 is still being manufactured, used by hobbyists, and actively written about today is a testament to its importance in history and education.
References
Here are some sites, documents, simulators, and other sundry materials used to bring you this textbook. Please enjoy.
Original IDE by Nick Morgan (skilldrick) (Running example)
Augmented Skilldrick IDE by Chris Tyler (ctyler) (Running example) (Source code examples)
6502 Architecture by Andrew Jacobs (BitWise)
The Visual 6502
Basic Multiplication and Division