SDCC's z80 crt0 puts the reset vector at 0x0000 (jp init) and the init stub (set SP, call _main) at an absolute .org 0x100. Passing `--code-loc 0x100` relocated the _CODE segment on top of that init stub, so on reset the CPU jumped into __clock/_exit (rst 0x08 then ret with a garbage stack) and derailed into NOP land before ever reaching main — every Z80 C program ran but drove nothing (z80-led-chaser-c compiled yet the LEDs never moved). Verified via a standalone chip-WASM harness: with the flag the chaser does 0 LED writes; without it, it walks the bit (8 writes). Pairs with the z80-cpu RAM map now covering 0x8000-0xFFFF so the crt0's SP=0 stack is real RAM. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| core | ||
| database | ||
| mcp | ||
| models | ||
| schemas | ||
| services | ||
| utils | ||
| __init__.py | ||
| main.py | ||