Skip to content
Techniques & Technology

Memory Mapping

Addresses for everything

Memory-mapped I/O places hardware registers at specific addresses, allowing software to control graphics, sound, and input by reading and writing memory locations.

commodore-64NESAmiga hardwareprogramminglow-level

Overview

Memory mapping assigns specific memory addresses to hardware registers, allowing programs to control peripherals through normal load/store operations rather than special I/O instructions. This approach defined how programmers interacted with 8-bit and 16-bit hardware.

Examples

Commodore 64:

  • $D000-$D3FF: VIC-II graphics chip
  • $D400-$D7FF: SID sound chip
  • $DC00-$DCFF: CIA#1 (keyboard, joystick)

NES:

  • $2000-$2007: PPU registers
  • $4000-$4017: APU and I/O

Programming Model

; C64: Set border colour to black
LDA #$00
STA $D020    ; Border colour register

; C64: Set volume
LDA #$0F
STA $D418    ; SID volume register

Advantages

  • Consistent programming model
  • Works with all CPU instructions
  • No special I/O instructions needed
  • Debuggers can monitor register access

See Also