#!/bin/bash # Compile BASIC for the Z-80 and write basic.mem (64 KB RAM image) and basic.bin. set -e cd "$(dirname "$0")" mkdir -p out sdasz80 -plosgff out/crt0.rel crt0.s sdcc -mz80 --opt-code-speed --max-allocs-per-node 20000 --std-sdcc11 -c -o out/basic.rel basic.c sdcc -mz80 --no-std-crt0 --code-loc 0x0080 --data-loc 0x8000 -o out/basic.ihx out/crt0.rel out/basic.rel python3 ../tools/ihx2mem.py out/basic.ihx basic.bin basic.mem