Skip to content
Hardware

6510: The C64's Custom Core

A 6502 with an I/O trick up its sleeve

The MOS 6510 added an integrated I/O port to the 6502, giving the Commodore 64 its signature memory banking and tape control.

C64 cpuprocessorsmos-technologycommodore 1982โ€“present

Overview

The MOS 6510 is essentially a 6502 with an integrated 6-bit I/O port at addresses $00 and $01. This seemingly minor addition gave the Commodore 64 its flexible memory mapping, allowing programmers to swap ROM in and out of the address space and control the datasette.

Fast facts

  • Clock speed: 0.985 MHz (PAL) / 1.023 MHz (NTSC).
  • Compatibility: 100% instruction-compatible with 6502.
  • I/O port: 6 bits at $00 (data direction) and $01 (data).
  • Pin count: 40-pin DIP package.

The I/O port

The magic lives at two special addresses:

AddressFunction
$00Data Direction Register (DDR) - 1=output, 0=input
$01Port data - controls memory mapping and tape

Port bit assignments

BitFunction
0LORAM - BASIC ROM visibility
1HIRAM - KERNAL ROM visibility
2CHAREN - Character ROM / I/O visibility
3Cassette write line
4Cassette sense (input)
5Cassette motor control

Memory banking

By manipulating bits 0-2 of $01, programmers can:

  • Hide BASIC ROM: gain 8KB at $A000-$BFFF for machine code.
  • Hide KERNAL ROM: gain 8KB at $E000-$FFFF (requires custom IRQ handling).
  • Access character ROM: read font data at $D000-$DFFF instead of I/O.
  • Full 64KB RAM: set all three bits low for complete RAM access.

Common configurations

$01 valueConfiguration
$37Default: BASIC + KERNAL + I/O visible
$36BASIC hidden, KERNAL + I/O visible
$35BASIC + KERNAL hidden, I/O visible
$34All ROM hidden, I/O visible
$30All RAM visible (64KB)

Why it matters

The 6510โ€™s I/O port let the C64 punch above its weight. Games could claim the full 64KB while still using ROM routines when convenient. This flexibility, combined with the VIC-II and SID, made the C64 the dominant gaming platform of the 8-bit era.

See also