Files
Basys3Terminal/monitor/build.sh
T
brad ArantandClaude Opus 5.5 fe1daf180d Monitor: Z-80 assembler (ASM "file", A addr)
Two-pass table-driven assembler in the monitor: assembles BASIC-saved
source files from the file system, or one line at a time with A addr.
Labels, EQU/ORG/DB/DW/DS/END, expressions. Table generated from the
disassembler (tools/gen-asmtab.py); round-trip and sdasz80 tests, plus a
Z-80 build run in z80emu. Monitor RAM grows to 6000-7FFF for the symbol
table. Works around an SDCC 4.5 inline strcpy bug with s_copy().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 16:42:42 -08:00

13 lines
623 B
Bash
Executable File

#!/bin/bash
# Compile the monitor and write monitor.mem (its 32 KB bank) and monitor.bin.
set -e
cd "$(dirname "$0")"
mkdir -p out
sdasz80 -plosgff out/crt0.rel crt0.s
sdcc -mz80 --opt-code-size --max-allocs-per-node 20000 --std-sdcc11 -c -o out/monitor.rel monitor.c
sdcc -mz80 --no-std-crt0 --code-loc 0x0180 --data-loc 0x6000 -o out/monitor.ihx out/crt0.rel out/monitor.rel
python3 ../tools/ihx2mem.py out/monitor.ihx out/monitor-full.bin out/monitor-full.mem
head -c 32768 out/monitor-full.bin > monitor.bin
head -n 32768 out/monitor-full.mem > monitor.mem
grep -E '^ *_DATA|^ *_CODE' out/monitor.map | head -2 || true