davervw / c64-io_monitor

Commodore 64 Kernel I/O entry point monitor utility

Home Page:https://techwithdave.davevw.com/2021/12/trace-c64-io-kernal-jump-table-calls.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Commodore 64 Kernel I/O entry point monitor utility

https://techwithdave.davevw.com/2021/12/trace-c64-io-kernal-jump-table-calls.html

License:MIT License


Languages

Language:Assembly 95.6%Language:Shell 4.4%