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>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-11-28 16:42:42 -08:00
1 parent 88b5942da5
commit fe1daf180d
16 files changed
+14320 -13257

No files matched your search

+2 -2
View File
@@ -26,7 +26,7 @@
// The monitor: an NMI (Pause key, port 61, a breakpoint or the step counter)
// pushes the program's PC and jumps to 0066h, where both BASIC and the monitor
// ROM hold the same few bytes: they switch the monitor bank in, which replaces
// 0000-7FFF with the monitor's ROM (0000-6FFF) and RAM (7000-7FFF), and leave
// 0000-7FFF with the monitor's ROM (0000-5FFF) and RAM (6000-7FFF), and leave
// through 0070h, which switches it out again and returns. No NMI is taken while
// the bank is in, or between the request and the bank coming in.
//
@@ -35,7 +35,7 @@
module z80_system #(
parameter MEM_FILE = "basic.mem",
parameter MON_FILE = "monitor.mem",
parameter MON_RAM = 16'h7000,
parameter MON_RAM = 16'h6000,
parameter CPU_HZ = 100_000_000,
parameter ROM_TOP = 16'h8000
) (