#!/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 0x7000 -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