Introduction
The disassembly replaces an operand address with a name when the address is one of these:
jsr $ffd2 is shown as jsr CHROUT, and sta $d020 as
sta VIC_BORDER. Only a whole operand address is named, not an address plus an
index offset, and the instruction detail shows what the name is. The names are those of the
Commodore 64 Programmer’s Reference Guide and Mapping the C64 where those
exist; the VIC-II, SID and CIA names are spelled out for readability.
The KERNAL jump table
The KERNAL ROM’s documented entry points, a table of JMP instructions at
$FF81–$FFF5 that stays at the same addresses in every KERNAL version.
| Address | Name | What it does |
|---|---|---|
$FF81 | CINT | Initialise the screen editor and the VIC-II |
$FF84 | IOINIT | Initialise the input and output devices |
$FF87 | RAMTAS | Initialise RAM and the tape buffer, set the top and bottom of memory |
$FF8A | RESTOR | Restore the default I/O vectors |
$FF8D | VECTOR | Read or set the I/O vectors |
$FF90 | SETMSG | Control the kernel messages |
$FF93 | SECOND | Send a secondary address after LISTEN |
$FF96 | TKSA | Send a secondary address after TALK |
$FF99 | MEMTOP | Read or set the top of RAM |
$FF9C | MEMBOT | Read or set the bottom of RAM |
$FF9F | SCNKEY | Scan the keyboard |
$FFA2 | SETTMO | Set the IEEE time-out flag |
$FFA5 | ACPTR | Read a byte from the serial bus |
$FFA8 | CIOUT | Send a byte to the serial bus |
$FFAB | UNTLK | Send UNTALK |
$FFAE | UNLSN | Send UNLISTEN |
$FFB1 | LISTEN | Tell a device to listen |
$FFB4 | TALK | Tell a device to talk |
$FFB7 | READST | Read the I/O status byte |
$FFBA | SETLFS | Set the logical file, device and secondary address |
$FFBD | SETNAM | Set the file name |
$FFC0 | OPEN | Open a logical file |
$FFC3 | CLOSE | Close a logical file |
$FFC6 | CHKIN | Make a file the input channel |
$FFC9 | CHKOUT | Make a file the output channel |
$FFCC | CLRCHN | Restore the default input and output channels |
$FFCF | CHRIN | Read a character from the input channel |
$FFD2 | CHROUT | Write a character to the output channel (the screen by default) |
$FFD5 | LOAD | Load a file into memory |
$FFD8 | SAVE | Save memory to a file |
$FFDB | SETTIM | Set the real-time clock |
$FFDE | RDTIM | Read the real-time clock |
$FFE1 | STOP | Test the STOP key |
$FFE4 | GETIN | Read a character from the keyboard buffer |
$FFE7 | CLALL | Close all files |
$FFEA | UDTIM | Advance the real-time clock |
$FFED | SCREEN | Return the screen size |
$FFF0 | PLOT | Read or set the cursor position |
$FFF3 | IOBASE | Return the address of the I/O chips |
CPU vectors and ROM routines
| Address | Name | What it is |
|---|---|---|
$FFFA | NMI_VECTOR | Non-maskable interrupt vector (ROM: $FE43) |
$FFFC | RESET_VECTOR | Reset vector (ROM: $FCE2) |
$FFFE | IRQ_VECTOR | Interrupt request and BRK vector (ROM: $FF48) |
$E544 | CLEAR_SCREEN | Clear the screen (ROM routine) |
$EA31 | IRQ_STANDARD | The standard IRQ routine: scans the keyboard, updates the clock |
$EA81 | IRQ_EXIT | The end of the standard IRQ routine: pulls the registers and returns |
$FE43 | NMI_ENTRY | The standard NMI routine |
$FCE2 | RESET_ENTRY | The RESET routine |
The ROM routines are at the addresses of the standard C64 ROM; other ROM versions and replacement KERNALs may put them elsewhere.
VIC-II ($D000–$D02E)
| Address | Name | What it is |
|---|---|---|
$D000–$D00F | VIC_SPRITE0_X, VIC_SPRITE0_Y … VIC_SPRITE7_X, VIC_SPRITE7_Y | The X and Y position of each of the 8 sprites (X and Y alternate) |
$D010 | VIC_SPRITES_X8 | Bit 8 of the X position of each sprite |
$D011 | VIC_CONTROL1 | Control register 1: vertical scroll, 24/25 rows, screen on, bitmap mode, raster bit 8 |
$D012 | VIC_RASTER | Raster line (read), raster interrupt line (write) |
$D013 | VIC_LIGHTPEN_X | Light pen X |
$D014 | VIC_LIGHTPEN_Y | Light pen Y |
$D015 | VIC_SPRITE_ENABLE | Sprite enable bits |
$D016 | VIC_CONTROL2 | Control register 2: horizontal scroll, 38/40 columns, multicolour mode |
$D017 | VIC_SPRITE_EXPAND_Y | Sprite double-height bits |
$D018 | VIC_MEMORY | Screen memory and character set / bitmap pointers |
$D019 | VIC_IRQ_FLAGS | Interrupt flags (write 1 to clear) |
$D01A | VIC_IRQ_MASK | Interrupt enable mask |
$D01B | VIC_SPRITE_PRIORITY | Sprite behind-background priority bits |
$D01C | VIC_SPRITE_MULTICOLOUR | Sprite multicolour bits |
$D01D | VIC_SPRITE_EXPAND_X | Sprite double-width bits |
$D01E | VIC_SPRITE_COLLISION | Sprite-to-sprite collision bits |
$D01F | VIC_BACKGROUND_COLLISION | Sprite-to-background collision bits |
$D020 | VIC_BORDER | Border colour |
$D021 | VIC_BACKGROUND0 | Background colour 0 |
$D022 | VIC_BACKGROUND1 | Background colour 1 |
$D023 | VIC_BACKGROUND2 | Background colour 2 |
$D024 | VIC_BACKGROUND3 | Background colour 3 |
$D025 | VIC_SPRITE_MC0 | Sprite multicolour 0 |
$D026 | VIC_SPRITE_MC1 | Sprite multicolour 1 |
$D027–$D02E | VIC_SPRITE0_COLOUR … VIC_SPRITE7_COLOUR | The colour of each sprite |
SID ($D400–$D41C)
Each of the three voices has seven registers, voice 1 at $D400, voice 2 at
$D407 and voice 3 at $D40E. The names are SID_V1_…,
SID_V2_… and SID_V3_….
| Offset in the voice | Name (voice 1) | What it is |
|---|---|---|
| +0 | SID_V1_FREQ_LO | Frequency, low byte |
| +1 | SID_V1_FREQ_HI | Frequency, high byte |
| +2 | SID_V1_PULSE_LO | Pulse width, low byte |
| +3 | SID_V1_PULSE_HI | Pulse width, high nibble |
| +4 | SID_V1_CONTROL | Waveform and gate |
| +5 | SID_V1_ATTACK_DECAY | Attack and decay |
| +6 | SID_V1_SUSTAIN_RELEASE | Sustain and release |
| Address | Name | What it is |
|---|---|---|
$D415 | SID_FILTER_LO | Filter cut-off, low 3 bits |
$D416 | SID_FILTER_HI | Filter cut-off, high byte |
$D417 | SID_FILTER_CONTROL | Filter resonance and voice routing |
$D418 | SID_VOLUME | Volume and filter mode |
$D419 | SID_POT_X | Paddle X (read) |
$D41A | SID_POT_Y | Paddle Y (read) |
$D41B | SID_OSC3 | Voice 3 oscillator output (read) |
$D41C | SID_ENV3 | Voice 3 envelope output (read) |
CIA 1 ($DC00) and CIA 2 ($DD00)
The two CIA chips have the same sixteen registers. CIA 1 handles the keyboard, the joysticks
and the IRQ; CIA 2 handles the serial bus, the RS-232 port, the NMI and the choice of which
16 KB bank the VIC-II sees. The names are CIA1_… and CIA2_….
| Offset | Name (CIA 1) | What it is |
|---|---|---|
| +0 | CIA1_PORT_A | Port A |
| +1 | CIA1_PORT_B | Port B |
| +2 | CIA1_DDR_A | Port A data direction |
| +3 | CIA1_DDR_B | Port B data direction |
| +4 | CIA1_TIMER_A_LO | Timer A, low byte |
| +5 | CIA1_TIMER_A_HI | Timer A, high byte |
| +6 | CIA1_TIMER_B_LO | Timer B, low byte |
| +7 | CIA1_TIMER_B_HI | Timer B, high byte |
| +8 | CIA1_TOD_TENTHS | Time of day, tenths of a second |
| +9 | CIA1_TOD_SECONDS | Time of day, seconds |
| +10 | CIA1_TOD_MINUTES | Time of day, minutes |
| +11 | CIA1_TOD_HOURS | Time of day, hours |
| +12 | CIA1_SERIAL | Serial data register |
| +13 | CIA1_IRQ | Interrupt control (flags when read, mask when written) |
| +14 | CIA1_CONTROL_A | Control register A |
| +15 | CIA1_CONTROL_B | Control register B |
Zero page and system locations
| Address | Name | What it is |
|---|---|---|
$00 | CPU_DDR | 6510 port data direction register |
$01 | CPU_PORT | 6510 port: memory configuration and cassette control |
$2B | TXTTAB | Start of BASIC text (low) |
$2D | VARTAB | Start of BASIC variables (low) |
$2F | ARYTAB | Start of BASIC arrays (low) |
$31 | STREND | End of BASIC arrays (low) |
$33 | FRETOP | Bottom of the string heap (low) |
$37 | MEMSIZ | Top of BASIC memory (low) |
$90 | STATUS | I/O status byte (ST) |
$91 | STKEY | STOP key flag |
$99 | DFLTN | Default input device |
$9A | DFLTO | Default output device |
$A0 | JIFFY_HI | Jiffy clock, high byte (TI) |
$A1 | JIFFY_MID | Jiffy clock, middle byte |
$A2 | JIFFY_LO | Jiffy clock, low byte |
$C6 | KEY_COUNT | Number of characters in the keyboard buffer |
$CB | KEY_CURRENT | Matrix code of the key now pressed |
$D3 | CURSOR_COLUMN | Cursor column on the line |
$D6 | CURSOR_ROW | Cursor row |
$0277 | KEY_BUFFER | Keyboard buffer (10 bytes) |
$0286 | CURSOR_COLOUR | Current character colour |
$0288 | SCREEN_PAGE | High byte of the screen memory address |
$0314, $0315 | IRQ_RAM_VECTOR, IRQ_RAM_VECTOR_HI | IRQ vector, low and high byte (the ROM routine calls through it) |
$0316, $0317 | BRK_RAM_VECTOR, BRK_RAM_VECTOR_HI | BRK vector, low and high byte |
$0318, $0319 | NMI_RAM_VECTOR, NMI_RAM_VECTOR_HI | NMI vector, low and high byte |
$D800 | COLOUR_RAM | Start of colour RAM (1000 bytes) |
A name applies to the one address given: the second byte of a pointer has no name of its own
except the vectors at $0314–$0319.