Classroom Glossary Public page

Week 2: The 6502 ISA Anchor

The 6502 ran the Apple II, the Commodore 64, the NES, the BBC Micro, and the Atari 2600. CSA-101 named it as the canonical 8-bit ISA every student should be able to read. CON-101 has you writing it and running it on synthesised silicon.


Reading

  • Altice, I Am Error, Chapter 2 (The Famicom CPU and 6502 in particular). Roughly thirty pages.
  • Copetti, NES writeup section on CPU. Free, ten minutes.
  • nesdev.org wiki: CPU, the canonical web reference for the NES 6502.
  • Hugg, Designing Video Game Hardware in Verilog, the chapter introducing the 6502 in the context of the Atari 2600 architecture.

Lecture

Roughly three hours across two sessions. Key arc:

  • 6502 register set: A, X, Y, SP, PC, P. Three general-purpose, two index, one stack pointer, one program counter, one status.
  • Addressing modes. Immediate, zero-page, absolute, indexed, indirect. Why the zero-page shortcut existed.
  • Instruction encoding. The byte is the unit; the mnemonic is for humans.
  • Memory-mapped I/O. Why retro consoles used it and modern systems still do.
  • The cc65 toolchain. Source to NES ROM in three commands.

Lab pack

Lab Pack 2 walks a tiny screen-fill program from cc65 source to NES core. See Lab Pack 2: 6502 Assembly on the NES Core.

Classroom tools

  • Workbench: 6502 REPL Workbench for the no-hardware path. Hand-write 6502, watch the bytes appear, step through it.
  • cc65 plus ld65 plus ca65 installed locally; the SETUP guide walks the install.
  • SPK-101 classroom: NES debugger R7 (run your assembled ROM with breakpoints, watch the A register).

Architecture comparison sidebar

The 6502 has three general-purpose registers; a modern x86_64 has sixteen. The 6502 has roughly fifty-six instructions; ARMv8 has hundreds. The pedagogical point is that the 6502's tiny surface is not primitive, it is the architecture-design discipline of doing more with less. CSA-101 already made a related point about the RV32I-Lite; CON-101 makes it again with a different shape.

Reflection prompts

  1. Why does the 6502 dedicate a whole page of memory (the zero page) to a faster addressing mode? What is the trade?
  2. Compare 6502 LDA #$FF to the equivalent on RV32I-Lite. Which is denser? Why?
  3. If you were designing a CPU for a 1983 cartridge-based console with a fifty-cent silicon budget, what would you keep from the 6502 and what would you drop?

What is next

Module 3 opens the NES PPU. You stop writing CPU code and start reading the picture-processing-unit Verilog the community core ships.