From a77dbcafad91ec6f730fab7f2b1b7e1514df65ee Mon Sep 17 00:00:00 2001 From: David Montero Date: Wed, 3 Jun 2026 05:53:53 +0200 Subject: [PATCH] fix(examples): z80-led-chaser-c used invalid SDCC __at() cast syntax `(*(volatile unsigned char __at(0xC000)))` uses __at as a cast operator, which neither avr-gcc nor sdcc accept (sdcc: "syntax error: token -> ')'"). __at is a storage specifier, not an operator. Use the portable absolute- address pointer form `(*(volatile unsigned char *)0xC000)`, which sdcc -mz80 compiles cleanly. Verified: produces a 462-byte ROM. Co-Authored-By: Claude Opus 4.8 --- frontend/src/data/examples-retro-intel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/data/examples-retro-intel.ts b/frontend/src/data/examples-retro-intel.ts index a7db3db3..8b38749a 100644 --- a/frontend/src/data/examples-retro-intel.ts +++ b/frontend/src/data/examples-retro-intel.ts @@ -42,8 +42,8 @@ const chaserZ80C = `/* LED chaser written in C, compiled to Z80 by SDCC. * Behaviour: walks a single LED back and forth across the 8 outputs * (true Larson scanner, with direction reversal). */ -#define LED_OUT (*(volatile unsigned char __at(0xC000))) -#define BTN_IN (*(volatile unsigned char __at(0xC003))) +#define LED_OUT (*(volatile unsigned char *)0xC000) +#define BTN_IN (*(volatile unsigned char *)0xC003) static void delay(unsigned int loops) { while (loops--) {