c64-io_monitor icon indicating copy to clipboard operation
c64-io_monitor copied to clipboard

Commodore 64 Kernel I/O entry point monitor utility

C64 IO_Monitor

Author: David R. Van Wagner

6502 Assembly project to monitor C64 Kernal I/O entry points usage.

Hooks entry points and increments counts as Kernal calls are made, with max count of 255 each. Works by copying C64 ROMs to RAM, patching RAM, and running from RAM (no, it doesn't patch lower memory indirect jumps). Optionally logs a trace of all individual calls with arguments and return values if memory is reserved (upper BASIC memory limit lowered prior to initializing).

Common use is to perform operations in BASIC, then display counts/trace to see what Kernal calls were made. Interestingly, see what Kernal I/O calls are made when you make a syntax error.

Usage:

LOAD "0:*",8,1
POKE 56,128 : REM RESERVE 8K FOR LOG
NEW
SYS 49152 : REM INITIALIZE HOOKS
SYS 49155 : DISPLAY COUNTS
SYS 49158 : DISPLAY LOG
REM STOP + RESTORE TO STOP

Example: Example screenshot

Produced with ACME and https://github.com/Esshahn/acme-assembly-vscode-template

Built C64 disk image is here and PRG file is here.

More details at blog.davevw.com article