compiler-sccz80

Diagnose sccz80 code generation and classic compiler builds for z88dk targets.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Debugging miscompiled C code or unexpected assembly output from z88dk's sccz80 compiler requires deep knowledge of its calling conventions, peephole optimization pipeline, and per-CPU runtime libraries, which are scattered across the toolchain. ## Core Features & Use Cases - Compiler Flag Reference: Documents CPU targeting flags (-m8080, -mz80, -mr4k, etc.), floating-point modes (ieee, mbf32, z88), and code generation options for z88dk-sccz80. - Peephole Pipeline Guidance: Explains how z88dk-copt applies lib/z80rules.* files to compiler output only, including the z80rules.8 inline-int case. - Runtime Layout: Maps the sccz80 runtime under libsrc/l/sccz80/ per CPU variant (5-z80, 7-8085, 8-8080). - Use Case: When a classic -compiler=sccz80 build produces wrong floating-point division results, use this Skill to learn that sccz80 may rewrite 1.0f/x into inv(x) and how to force the runtime numerator to hit fsdiv. ## Quick Start Ask the AI to explain why sccz80 generated specific assembly for a classic z88dk build and which copt rules or runtime routines are involved.

Frequently Asked Questions about compiler-sccz80

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

FAQPage Schema
How do I select the sccz80 compiler in z88dk?

sccz80 is the default compiler for most classic CLIB targets and for -clib=new, so zcc invokes it automatically. You normally compile through zcc rather than calling z88dk-sccz80 directly.

How does the copt peephole optimizer work with sccz80?

z88dk-copt applies rule files from lib/z80rules.* to the compiler's assembly output only, not to hand-written assembly. Inline integer operations may additionally load z80rules.8 during optimization.

Which CPUs does z88dk-sccz80 support?

sccz80 targets the 8080, 8085, z80, z80n, z180, ez80 in z80 mode, Rabbit 2000A/3000/4000, Gameboy CPU, and KC160 via -m flags such as -m8080, -mz80, and -mr4k.

Why does sccz80 produce wrong results for 1.0f/x division?

sccz80 may rewrite 1.0f/x into inv(x), changing which runtime routine executes. Force the numerator through a runtime value so the expression hits the fsdiv routine instead.

When should I invoke z88dk-sccz80 directly instead of zcc?

Direct invocation is rare and only appropriate when debugging the compiler front end itself. For normal compilation, always use zcc with the appropriate +target and -compiler options.