liveBook · Manning

6502 assembler

As explained in Classic Game Programming on the NES: Make your own retro video game

A program that translates assembly-language source code into machine code or relocatable object code.

A 6502 assembler translates assembly-language source code into machine code that the NES can understand. It turns typed instructions into a final ROM image, making it a core part of the NES development environment. section 2.3 section 2.6

The NES uses a modified 8-bit 6502 processor. Assembly gives direct control over limited processing power, memory, and registers, which helps meet the precise timing required for graphics, music, and sound effects. section 1.3 section 3.0

A practical NES assembler workflow is:

  • Edit assembly-language source code in a text editor. section 2.0
  • Assemble the source into machine code and a final ROM image. section 2.3 section 2.6
  • Run and debug the resulting game with the surrounding NES development tools. section 2.0

Choosing an assembler

cc65 supports 6502 assembly files and the NES, and its syntax is used by the example code. NESASM and ASM6 are alternative options. section 2.3

Learning the assembler starts with the processor’s small instruction set, memory, registers, moving data, and addressing modes. The goal is not a complete language reference but enough practical knowledge to follow and run NES game code. section 3.0

How Classic Game Programming on the NES: Make your own retro video game covers it

How deep it goes
Introduces instructions, memory, registers, and addressing modes, but stops short of a complete assembler tutorial.
Examples
Uses assembly source, machine code, ROM images, and NES game code as its concrete artifacts.
What it assumes
Assumes no assembly background and begins with the 6502 instruction set, memory, registers, and data movement.
What you can do after
Build NES programs from assembly source using cc65 and produce ROM images for execution and debugging.
How it connects
Connects assembly language with the 6502 processor, NES hardware, C, memory, registers, and game loops.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Classic Game Programming on the NES: Make your own retro video game. The section links point to the parts of the book it draws on.