Repository navigation
KickC Enhanced 0.9.0
KickC Enhanced 0.9.0
KickC Enhanced is an optimizing C99 compiler fork for the MOS 6502/6510 family (C64, VIC-20, Plus/4, NES, Atari XL, Mega65). This release introduces major performance leaps, advanced peephole optimization passes, and 267 new MOS 6502 ASM synthesis fragments.
Highlights & Key Improvements
-
267 New / Repaired MOS 6502 ASM Fragments:
- Native struct-pointer decrements and member comparisons (
if (arr[i].val > 0) arr[i].val--;). - Optimal zero-branch boolean NOT (
!) lowerings. - Direct 32-bit (dword) comparisons against zero.
- 16-bit word byte-aligned shifts lowered to 4-instruction transfers without shift loops.
- Word pointer indexing, memory-offset arithmetic, and complementary signed/unsigned casts.
- Native struct-pointer decrements and member comparisons (
-
NMOS-6510 Undocumented / Illegal Opcode Synthesis:
- Active when targeting
mos6502x/rom6502x. - Synthesizes deterministic green opcodes:
LAX,SAX(3-cycle zero-page stores),ALR #{imm},DCP,ISC. - Redundant
CMP #0,CPX #0,CPY #0elimination and branch flag predication. - 16-to-8 bit right-shift by 2 folding via accumulator (
lsr; lsr).
- Active when targeting
-
Tail Call Optimization (TCO) & Return Trampoline Relaxation:
- Converts function tail calls (
jsr target; rts) intojmp target. - Analyzes conditional long branch trampolines jumping to function return blocks and relaxes them directly to local inverted branches and returns.
- Converts function tail calls (
-
Dead Store & Dead Load-and-Store Pair Elimination:
- Linear
$O(1)$ elimination of unused temporary stores and dead function returns. - Recursive
CanonicalResolvertracks all.label Name = Targetdefinitions and address aliases to ensure variables read under aliases are never falsely eliminated. - Safe register A tracking preserves preceding loads when subsequent instructions consume register A.
- Linear
-
Static Register Tracking Across Anonymous Forward Labels:
- Tracks static values of
A,X, andYacross local forward-only labels (!:) when skipped instructions do not modify the registers, eliminating thousands of redundant loads in tight loops.
- Tracks static values of
-
Multi-Core Compiler Architecture & Speedups:
- Parallel dominator tree calculation and multi-core register uplift analysis.
- Reduces compilation times for massive multi-bank codebases from >20 minutes down to ~90 seconds.
Installation & Usage
Download and extract kickc-release.zip. Requires Java 8 or higher.