Machine-code monitor, fast serial, memory files, Ctrl-Alt-Del

Monitor: the CPU gets an NMI (taken at an instruction start, or from
HALT) raised by the Pause key, BASIC's MONITOR, two hardware breakpoint
comparators or a step counter. It enters through a trampoline at 0066h
(the same bytes in BASIC's ROM and the monitor's, basic/tramp.s) that
switches in a 32 KB monitor bank over 0000-7FFF. The monitor (monitor/,
C) runs on the terminal's new alternate screen (CSI ?47 h/l, a second
screen page; graphics hidden) and shows registers, flags, a disassembly
from PC, the stack and memory. Commands: Enter/S n step, O step over,
G/X go, B breakpoint, D/M windows, E edit, R registers, and SAVE/LOAD/
DIR for memory files. The disassembler covers every opcode;
monitor/test-disasm.py round-trips all forms through sdasz80. Lockstep
CPU tests still match the reference emulator.

BASIC: MONITOR, CALL addr, BSAVE "N",start,len and BLOAD "N"[,addr]
(memory files: load address then bytes). The DATE clock moves to
F3F8h so the monitor can date files. F000-F3F7 is kept free for
machine code (program area 21076 bytes).

Serial: SW1:0 = 10 is now 921600 and 11 is 3 Mbaud. A 17 KB burst to
BASIC lists back identical at both on the board. send-bas.py reads
the echo while sending; unread, it could stall the PC's flow control.

Ctrl-Alt-Del in Z-80 mode restarts the Z-80 like BTND.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
brad ArantandClaude Opus 5.5 committed 2026-11-28 11:17:54 -08:00
1 parent 767377f38d
commit 634e314010
27 files changed
+37481 -3039

No files matched your search

+5 -1
View File
@@ -11,6 +11,7 @@
// CSI A B C D E F G H I J K L M P S T X Z @ ` a d e f g h l m n q r s u c
// CSI ? J K h l n CSI > c CSI ! p
// Modes: IRM(4) LNM(20) DECCKM(?1) DECSCLM(?4) DECOM(?6) DECAWM(?7) DECTCEM(?25)
// alternate screen ?47 (parameters stop at 255, so not ?1047/?1049)
// SGR 0 1 4 5 7 8 21-28 30-49 90-107, 38/48;5;n and 38/48;2;r;g;b (approximated)
// DECLL (CSI n q) drives four LEDs.
// OSC, DCS, APC, PM and SOS strings (e.g. titles, OSC 3008) are discarded.
@@ -52,7 +53,8 @@ module term_ctrl (
output reg keypad_app,
output reg lnm,
output reg [3:0] dec_leds,
output reg bell
output reg bell,
output reg alt_scr // showing and writing the alternate screen
);
localparam [4:0] LAST_ROW = 5'd29;
localparam [6:0] LAST_COL = 7'd79;
@@ -319,6 +321,7 @@ module term_ctrl (
{g0, g1} <= 4'b0;
awm <= 1'b1;
cur_vis <= 1'b1;
alt_scr <= 1'b0;
stop <= 5'd0;
sbot <= LAST_ROW;
{sv_row, sv_col, sv_pend, sv_om, sv_gl, sv_bold, sv_ul, sv_blink, sv_rev, sv_conceal} <= 0;
@@ -415,6 +418,7 @@ module term_ctrl (
if (v == 6) begin om <= on; row <= on ? stop : 5'd0; col <= 7'd0; pend <= 1'b0; end
if (v == 7) awm <= on;
if (v == 25) cur_vis <= on;
if (v == 47) alt_scr <= on;
end else begin
if (v == 4) irm <= on;
if (v == 20) lnm <= on;