compiler-zsdcc

Configures and upgrades the zsdcc SDCC-based compiler path in z88dk.

1.1k|206|Updated Mar 16, 2016
One-click install
npx skills add https://github.com/z88dk/z88dk --skill compiler-zsdcc-z88dk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compiler-zsdcc
Source: https://github.com/z88dk/z88dk/tree/main/.agents/skills/compiler-zsdcc
Command: npx skills add https://github.com/z88dk/z88dk --skill compiler-zsdcc-z88dk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Working with the zsdcc compiler in z88dk requires knowing which clib flags to use, how SDCC calling conventions differ from sccz80, and how to regenerate the z88dk-specific patch when the pinned SDCC revision changes. This Skill consolidates that knowledge so builds and patch upgrades are done correctly. ## Core Features & Use Cases - Compiler selection guidance: Explains -clib=sdcc_ix vs -clib=sdcc_iy, newlib integration, and when to prefer sccz80 for 8080/8085/gbz80 targets. - Patch regeneration procedure: Provides a step-by-step workflow for updating src/zsdcc/sdcc-z88dk.patch when the SDCC pin (SDCC_VERSION) changes, including ABI 0 enforcement, version banner, ChangeLog $Revision$ fix, peep special-function table, and tarball packaging for CI. - Use Case: When SDCC releases a new revision, follow the documented procedure to check out the new svn revision, re-apply all required z88dk hunks, verify a clean patch -p0 round-trip, and produce the zsdcc_r<rev>_src.tar.gz tarball for nightly builds. ## Quick Start Ask the assistant to regenerate the zsdcc patch for a new SDCC revision and verify that the ABI field, ChangeLog revision, and version banner all match the Makefile pin.

Frequently Asked Questions about compiler-zsdcc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compile C code with SDCC in z88dk?

Use zcc with an SDCC clib flag, for example `zcc +cpm -clib=sdcc_iy -vn hi.c -o hi`. The `-clib=sdcc_iy` variant reserves the IY register and is preferred on many targets, while `-clib=sdcc_ix` uses IX frame conventions defined by the target config.

What is the difference between sdcc_ix and sdcc_iy in z88dk?

sdcc_iy adds `--reserve-regs-iy` and is preferred on many newlib targets, while sdcc_ix uses IX frame conventions. Both often share the same library directory `lib/clibs/sdcc_ix`; check `lib/config/<target>.cfg` for the actual mapping.

Can I use zsdcc for 8080 or Game Boy targets?

No. zsdcc is intended for Z80-class work in z88dk. For 8080, 8085, or gbz80 classic products, use sccz80 or the 80cc compiler instead, since zsdcc does not support those CPUs.

Why does z88dk-zsdcc --version show the wrong build number?

SDCC's svn tree does not update the ChangeLog `$Revision$` keyword on every commit, so version.awk reads a stale number. The z88dk patch must force the ChangeLog revision to match the Makefile SDCC_VERSION pin.

How do I regenerate the zsdcc patch for a new SDCC revision?

Update Makefile SDCC_VERSION, check out the new svn revision into src/sdcc-build, apply the previous patch, fix rejects, force the ChangeLog revision string, then regenerate the unified diff and verify a clean `patch -p0` round-trip on a pristine checkout.

Is vanilla upstream SDCC the same as zsdcc?

No. Vanilla SDCC uses ABI 1 with `__sdcccall(1)`, while zsdcc is patched to ABI 0 with z88dk calling conventions like `__z88dk_callee`. Benchmark numbers from vanilla SDCC must not be mixed into zsdcc results.