Assembled by a collective of 150 expert Commodore 64 developers. This file is the primary reference for AI agents assisting with Commodore 64 application development. Core C64 platform knowledge is sourced from canonical reference books (see Sources below). Supplemental modern emulator workflow guidance is included for VICE 3.10 from
C:\Program Files\GTK3VICE-3.10-win64\doc\vice.txt.
This repository contains structured skills and reference material for developing software on the Commodore 64. Each subdirectory under skills/ is a self-contained topic skill. When answering a C64 development question, consult the most relevant skill first, then cross-reference the reference/ files.
| Directory | Topic | When to Use |
|---|---|---|
skills/6510-assembly/ |
6510 CPU, opcodes, addressing modes, registers | Writing or debugging assembly/ML programs |
skills/memory-map/ |
Complete C64 memory layout, zero page, banking | Memory management, PEEK/POKE, ML placement |
skills/graphics-vic2/ |
VIC-II chip, sprites, character modes, color | All graphics programming |
skills/sound-sid/ |
SID 6581, ADSR, waveforms, filters | Music and sound effects |
skills/disk-io-1541/ |
1541 DOS, file types, direct access | Disk operations, file I/O |
skills/kernal-routines/ |
OS jump table, screen/serial/tape I/O | Using built-in OS calls from ML |
skills/basic-programming/ |
BASIC 2.0 interpreter, extending BASIC, tokens | BASIC programs, BASIC extensions |
skills/interrupts/ |
IRQ, NMI, CIA timers, raster interrupts | Interrupt-driven code, timing |
skills/compiler-design/ |
Compiler & assembler construction for C64/128 | Writing compilers, assemblers, parsers |
skills/vice-emulator/ |
VICE emulator, autostart, monitor, snapshots, automation | Running, testing, and debugging C64 software in VICE |
| File | Contents |
|---|---|
reference/memory-map-complete.md |
All C64 memory locations with descriptions |
reference/6510-opcodes.md |
Full 6510 opcode table |
reference/kernal-jumplist.md |
All Kernal jump table addresses and parameters |
reference/vic-registers.md |
VIC-II chip register map |
reference/sid-registers.md |
SID chip register map |
reference/cia-registers.md |
CIA 6526 register map |
reference/disk-dos-commands.md |
1541 DOS command reference |
reference/vice-usage.md |
VICE 3.10 emulator, monitor, autostart, and automation reference |
| File | Description |
|---|---|
examples/hello-world.asm |
Minimal 6510 assembly hello world |
examples/sprite-demo.bas |
BASIC sprite programming demo |
examples/sound-demo.bas |
SID chip sound demo in BASIC |
examples/disk-access.bas |
Sequential and relative file access |
examples/irq-handler.asm |
Custom IRQ handler skeleton |
examples/kernal-io.asm |
Using Kernal routines for I/O |
examples/vice-autostart-c64os.bat |
Launch c64os.prg directly in x64sc |
examples/vice-monitor-c64os.txt |
VICE monitor playback script for debugging c64os.prg |
examples/vice-debug-c64os.bat |
Launch c64os.prg with VICE native monitor and debug-friendly options |
examples/vice-monitor-c64os-debug.txt |
Repeatable VICE debugging session with breakpoints, watchpoints, and keyboard injection |
The Commodore 64 (1982) features:
$0000–$00FF Zero Page — CPU registers, BASIC/Kernal variables (fast access)
$0100–$01FF Stack — 6510 hardware stack
$0200–$03FF Pages 2–3 — OS/BASIC working storage, vectors
$0400–$07FF Screen RAM — Default video matrix (40×25 = 1000 bytes)
$0800–$9FFF BASIC RAM — BASIC program area (default: $0801–$9FFF)
$A000–$BFFF BASIC ROM — Microsoft BASIC 2.0 (or RAM when banked out)
$C000–$CFFF Free RAM — ML programs, data (4KB always RAM)
$D000–$D3FF VIC-II — Graphics chip registers (I/O mode)
$D400–$D7FF SID — Sound chip registers (I/O mode)
$D800–$DBFF Color RAM — Screen color data (nybble wide, 1000 bytes)
$DC00–$DCFF CIA #1 — Keyboard, joystick, IRQ timer
$DD00–$DDFF CIA #2 — Serial bus, NMI timer, VIC-II bank select
$E000–$FFFF Kernal ROM — Operating system (or RAM when banked out)
Memory bank control — Location $0001 (6510 I/O port):
Bits 2-0: 000 = RAM everywhere
101 = BASIC+Kernal ROM, I/O (default)
110 = Kernal ROM + I/O, BASIC=RAM
111 = All ROM + I/O (normal)
| Address | Dec | Name | Description |
|---|---|---|---|
| $0000 | 0 | R6510 | 6510 I/O direction register |
| $0001 | 1 | M6510 | 6510 I/O port (memory bank/tape) |
| $0002 | 2 | — | Unused (free for user) |
| $0003-$0004 | 3-4 | ADRAY1 | Float→fixed vector |
| $0005-$0006 | 5-6 | ADRAY2 | Fixed→float vector |
| $0007 | 7 | CHARAC | Search character |
| $0014-$0015 | 20-21 | — | Integer value |
| $002B-$002C | 43-44 | TXTTAB | Start of BASIC program |
| $002D-$002E | 45-46 | VARTAB | Start of variable area |
| $0030-$0031 | 48-49 | FRETOP | Top of string storage |
| $0037-$0038 | 55-56 | MEMSIZ | Pointer to end of BASIC RAM |
| $0039-$003A | 57-58 | CURLIN | Current BASIC line number |
| $003E-$003F | 62-63 | OLDLIN | Previous BASIC line number |
| $0052-$0053 | 82-83 | OLDTXT | Previous BASIC text pointer |
| $007A-$007B | 122-123 | FNPNT | Floating point accumulator |
| $00AC-$00AD | 172-173 | STRNG1 | Start of string 1 |
| $00C1 | 193 | SAL | Save start address (low) |
| $00C2 | 194 | SAH | Save start address (high) |
| $00AE-$00AF | 174-175 | FRESPC | String utility pointer |
| $00FB-$00FE | 251-254 | — | Free zero-page (user) |
All Kernal routines are called via JSR to their jump table address ($FFxx). The jump table is always available regardless of ROM banking mode.
| Address | Name | Function |
|---|---|---|
| $FF81 | CINT | Initialize screen editor |
| $FF84 | IOINIT | Initialize I/O devices |
| $FF87 | RAMTAS | Test/initialize RAM |
| $FF8A | RESTOR | Restore default I/O vectors |
| $FF8D | VECTOR | Read/set RAM vectors |
| $FF90 | SETMSG | Control OS messages |
| $FF93 | SECOND | Send secondary address after LISTEN |
| $FF96 | TKSA | Send secondary address after TALK |
| $FF99 | MEMTOP | Read/set top of memory |
| $FF9C | MEMBOT | Read/set bottom of memory |
| $FF9F | SCNKEY | Scan keyboard |
| $FFA2 | SETTMO | Set serial bus timeout |
| $FFA5 | ACPTR | Input byte from serial bus |
| $FFA8 | CIOUT | Output byte to serial bus |
| $FFAB | UNTLK | Send UNTALK to serial bus |
| $FFAE | UNLSN | Send UNLISTEN to serial bus |
| $FFB1 | LISTEN | Command device to LISTEN |
| $FFB4 | TALK | Command device to TALK |
| $FFB7 | READST | Read I/O status word |
| $FFBA | SETLFS | Set logical/device/command |
| $FFBD | SETNAM | Set filename |
| $FFC0 | OPEN | Open logical file |
| $FFC3 | CLOSE | Close logical file |
| $FFC6 | CHKIN | Open channel for input |
| $FFC9 | CHKOUT | Open channel for output |
| $FFCC | CLRCH | Close input/output channels |
| $FFCF | BASIN | Input character from channel |
| $FFD2 | BSOUT | Output character to channel |
| $FFD5 | LOAD | Load from device |
| $FFD8 | SAVE | Save to device |
| $FFDB | SETTIM | Set real-time clock |
| $FFDE | RDTIM | Read real-time clock |
| $FFE1 | STOP | Test STOP key |
| $FFE4 | GETIN | Get character from queue |
| $FFE7 | CLALL | Close all files |
| $FFEA | UDTIM | Increment real-time clock |
| $FFED | SCREEN | Return screen dimensions |
| $FFF0 | PLOT | Read/set cursor position |
| $FFF3 | IOBASE | Return base address of I/O |
This knowledge base was compiled from these canonical references:
C:\Program Files\GTK3VICE-3.10-win64\doc\vice.txtWhen an AI agent receives a C64 development question:
skills/ subdirectoryreference/ files for specific register values, addresses, or opcodesskills/vice-emulator/SKILL.md and reference/vice-usage.mdWhen debugging a C64 program in VICE, agents should prefer this flow:
x64sc rather than the older x64-nativemonitor -keepmonopen -refreshonbreak for interactive debuggingsidefx offstep, next, return, and backtrace intentionally rather than single-stepping blindly$0001, $0314/$0315, screen RAM, color RAM, and I/O registersexamples/ to make debug sessions repeatableFor this repository specifically:
examples/vice-debug-c64os.bat launches c64os.prg with monitor-friendly optionsexamples/vice-monitor-c64os-debug.txt sets up a practical debug session for startup, banking, and command input10 FOR I=49152 TO 49162 : READ D : POKE I,D : NEXT
20 SYS 49152
30 DATA 169,0,141,32,208,169,15,141,33,208,96
POKE 56,192 : CLR ' Sets BASIC top to $C000 (49152)
JSR $FFB7 ; READST — status in Accumulator
BNE error ; any non-zero means error
SEI ; disable interrupts
LDA #<my_irq ; low byte of handler
STA $0314
LDA #>my_irq ; high byte
STA $0315
CLI ; enable interrupts
Powered by TurnKey Linux.