01 / Typed relations
Model control flow, memory access, and machine resources.
The graph stores routine, label, address, zero-page, ROM, and hardware-register nodes. Typed edges represent calls, ROM calls, jumps, branches, reads, writes, indirect accesses, and pointer references. Artifact, cartridge-bank, and drive-CPU identifiers distinguish identical 16-bit addresses. Each edge stores supporting evidence and a confidence value.
02 / Routine contracts
Infer routine contracts from 6502 code.
C64RE infers inputs, outputs, clobbers, preserved registers and flags, stack effects, call-site arguments, patched operands, and unresolved exits. Analysis includes known ROM ABIs and recursive call relationships; unresolved callees leave contracts partial.
03 / Change impact
Identify affected code and state before changing bytes.
change_impact traverses incoming call, jump, and branch edges; identifies readers of written addresses and references through pointer and jump tables; and finds claims that may be invalidated. It reports inferred state-preservation requirements. If trace data is available, the report includes observed raster-line timing, worst observed line occupancy, and remaining margin. Unresolved indirect jumps, self-modifying-code paths, and drive-CPU paths are reported as UNKNOWN rather than low risk.