Monitor Program — Annotated Disassembly
This is a fully annotated, bit-correct disassembly of the 2 Kb monitor ROM located at
$F800–$FFFF on the RCS Designers Board. The full source file is available in the Downloads section.
Overview
The monitor is a 2 Kb program that occupies $F800–$FEFF. It communicates via the on-chip UART at 9600 baud, 8N1 using port P0-6 as TxD and P0-7 as RxD via the on-board RS-232 level converters.
On startup it displays ** 740 MON V1.1 ** and enters a command loop, displaying a prompt [, waiting for a command character, echoing it inside ] brackets, then dispatching to the relevant routine.
Startup & Reset ($F80C)
; ---- RESET entry point ---- LAB_F80C: SEI ; disable interrupts CLD ; clear decimal mode CLT ; clear the T bit (740-specific) CLC ; clear carry CLV ; clear overflow LDX #$FF ; set X = $FF TXS ; set stack pointer to $FF (top of page 1) ; Configure P0-6 as UART TxD LDA #$40 ; mask for P0-6 STA LAB_F5 ; port 0 function register → P0-6 = TXD STA LAB_F7 ; port 0 data direction register → P0-6 = output ; Configure UART: Tx+Rx enable, Timer B f/8, parity disabled, 8-bit LDA #$C1 STA LAB_E6 ; UART control register LDA #$05 ; baud divisor for 9600 @ 7.3728 MHz STA LAB_FB ; baud rate generator (Timer B) ; Display startup banner LDX #<LAB_F8DA ; pointer to "** 740 MON V1.1 **" LDY #>LAB_F8DA SEC ; flag: newline needed before string JSR LAB_F8AE ; send null-terminated string at YX JSR LAB_F8C5 ; send CR+LF ; Initialise interrupt vector table (zero page $C4–$CF) to point to $F80C (RESET) ; ... then check for autostart ROM/RAM ...
Command Loop ($F913)
The main command loop resets the stack, then sends [, waits for a character, echoes it with ], searches the command table, and dispatches via the address table.
LAB_F913: LDX #$FF ; reset stack pointer on each command TXS CLD LAB_F917: LDA #'[' ; display opening bracket prompt JSR LAB_F8A0 ; transmit character JSR LAB_F877 ; receive a character (blocking) CMP #$0D ; CR? → ignore, send CR+LF, loop BNE LAB_F928 JSR LAB_F8C5 ; send CR+LF BNE LAB_F913 ; loop (branch always) LAB_F928: JSR LAB_F8A0 ; echo the command character PHA ; save it LDA #']' ; send closing bracket JSR LAB_F8A0 PLA ; restore command character LDX #$10 ; 16 entries in command table LAB_F934: CMP LAB_F957,X ; match against command table BEQ LAB_F942 ; found → dispatch DEX BPL LAB_F934 ; loop until all checked JSR LAB_F8CF ; not found → send '?' JMP LAB_F917
Monitor Commands
| Key | Function | Routine | Notes |
|---|---|---|---|
A | Set Accumulator | $F98A | Enter 2 hex digits |
B | Set BREAK address | $F9AF | Enter 4-digit hex address |
D | Send KIM hex records | $F9F8 | Upload from board to host |
G | Execute code | $FB57 | Jump to address (or PC if no address) |
L | Load KIM hex records | $FB6A | Download from host to board |
M | Display memory | $FC18 | 16 bytes/line; SPACE=next, /=edit |
P | Set Status register | $F98E | Enter 2 hex digits |
R | Display registers | $FC6C | Shows PC, P, SP, A, X, Y |
S | Set Stack pointer | $F99A | Enter 2 hex digits |
U | Load Intel hex records | $FBC0 | Standard Intel :llaaaarr format |
X | Set X register | $F992 | Enter 2 hex digits |
Y | Set Y register | $F996 | Enter 2 hex digits |
Z | Send Intel hex records | $FAA1 | Upload Intel hex to host |
* | Set Program Counter | $FCC9 | Enter 4-digit hex address |
/ | Input bytes | $FCE3 | Enter hex bytes at current address |
? | Display BREAK status | $FD15 | Shows BREAK address if set |
SPACE | Advance 16 bytes | $FC5B | Continue memory display |
Monitor Variable Map ($00B0–$00CF)
| Address | Label | Description |
|---|---|---|
$B4 | LAB_B4 | Saved Accumulator |
$B5 | LAB_B5 | Saved Status register |
$B6 | LAB_B6 | Saved X register |
$B7 | LAB_B7 | Saved Y register |
$B8 | LAB_B8 | Saved Stack pointer |
$B9 | LAB_B9 | Temp A storage |
$BA–$BB | LAB_BA/BB | [TO] address (low/high) |
$BC–$BD | LAB_BC/BD | Checksum (low/high) |
$BE–$BF | LAB_BE/BF | BREAK address (low/high) |
$C0 | LAB_C0 | Byte replaced by BREAK instruction |
$C1 | LAB_C1 | BREAK status ($AA = set) |
$C2–$C3 | LAB_C2/C3 | Saved Program Counter (low/high) |
$C4–$C5 | LAB_C4/C5 | TC/CNTR/BRK vector |
$C6–$C7 | LAB_C6/C7 | HE/VE vector |
$C8–$C9 | LAB_C8/C9 | Timer 1/2/3 vector |
$CA–$CB | LAB_CA/CB | RI/INT1 vector |
$CC–$CD | LAB_CC/CD | INT2 vector |
$CE–$CF | LAB_CE/CF | TC/CNTR code vector |