← Back to The Vault

Vault Entry

[📷 suggested: flowchart of KERNAL vectors and device numbers]

Overview

The KERNAL (Keyboard Entry Read, Network, And Link) ROM provides 39 entry points for device handling and system services. Commodore designed it as a stable “API” so BASIC, machine-code programs, and third-party cartridges could rely on consistent routines.

Fast facts

  • Entry points: located at $FF81–$FFF3, accessible via JMP vectors stored in RAM for easy patching.
  • Devices: numbered channels handle keyboard (0), screen (3), tape (1), disk (8), RS-232 (2/3), and user ports.
  • Compatibility: the same KERNAL concept appears in the VIC-20, PET, C16, and C128 families.

Core services

  • OPEN/CLOSE: OPEN and CLOSE manage logical file numbers and devices.
  • GET/CHRIN: read characters from keyboard, tape, or disk.
  • CHROUT: output characters, including control codes for screen formatting.
  • LOAD/SAVE: high-level routines to move data between memory and mass storage.

Lesson connections

  • BASIC Blocks 5–6 reference KERNAL vectors when manipulating device I/O or speeding up file operations.
  • Transition course dissects the KERNAL jump table to show how BASIC delegates hardware access.
  • Assembly lessons demonstrate hooking into vectors (e.g., GETIN, CHROUT) for custom keyboards or fastloaders.

Why patch it?

Cartridges and fastloaders replace selected vectors to accelerate disk/tape access or add tooling. Understanding the KERNAL is essential for compatibility and for falling back gracefully when hardware mods are absent.

See also