Intro to NES Assembly

hardware, nes, nintendo, games, assembly, programming, gaming

The Nintendo Entertainment System (NES) defined the look and feel of video games in the late 80's and early 90's. It was designed around the MOS Technologies 6502 CPU, a cheap microprocessor developed in 1975 and still manufactured today. The NES' impressive library of games was written using 6502 assembly language. Compared to assembly languages for modern processors, 6502 assembly is relatively simple, with only 53 possible instructions, one accumulator, two index registers, and a 256-byte stack. Combined with the NES' custom "Picture Processing Unit" (PPU) and highly optimized memory layout, these simple foundations allow for an incredibly diverse range of game experiences, and developers continually pushed the bounds of what the system was thought capable of until its commercial demise in 1995.

We will explore the design of the NES' hardware and memory layout, focusing on the system's graphical capabilities and limitations. We'll take a brief look at writing assembly code for the 6502 and put this into practice with techniques common to many types of games: metatile ("map") compression, collision detection, and random number generation. Finally, we'll discuss what a modern toolkit for NES assembly development looks like, and how you can get started developing your own NES games.