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

KeyFunctionRoutineNotes
ASet Accumulator$F98AEnter 2 hex digits
BSet BREAK address$F9AFEnter 4-digit hex address
DSend KIM hex records$F9F8Upload from board to host
GExecute code$FB57Jump to address (or PC if no address)
LLoad KIM hex records$FB6ADownload from host to board
MDisplay memory$FC1816 bytes/line; SPACE=next, /=edit
PSet Status register$F98EEnter 2 hex digits
RDisplay registers$FC6CShows PC, P, SP, A, X, Y
SSet Stack pointer$F99AEnter 2 hex digits
ULoad Intel hex records$FBC0Standard Intel :llaaaarr format
XSet X register$F992Enter 2 hex digits
YSet Y register$F996Enter 2 hex digits
ZSend Intel hex records$FAA1Upload Intel hex to host
*Set Program Counter$FCC9Enter 4-digit hex address
/Input bytes$FCE3Enter hex bytes at current address
?Display BREAK status$FD15Shows BREAK address if set
SPACEAdvance 16 bytes$FC5BContinue memory display

Monitor Variable Map ($00B0–$00CF)

AddressLabelDescription
$B4LAB_B4Saved Accumulator
$B5LAB_B5Saved Status register
$B6LAB_B6Saved X register
$B7LAB_B7Saved Y register
$B8LAB_B8Saved Stack pointer
$B9LAB_B9Temp A storage
$BA–$BBLAB_BA/BB[TO] address (low/high)
$BC–$BDLAB_BC/BDChecksum (low/high)
$BE–$BFLAB_BE/BFBREAK address (low/high)
$C0LAB_C0Byte replaced by BREAK instruction
$C1LAB_C1BREAK status ($AA = set)
$C2–$C3LAB_C2/C3Saved Program Counter (low/high)
$C4–$C5LAB_C4/C5TC/CNTR/BRK vector
$C6–$C7LAB_C6/C7HE/VE vector
$C8–$C9LAB_C8/C9Timer 1/2/3 vector
$CA–$CBLAB_CA/CBRI/INT1 vector
$CC–$CDLAB_CC/CDINT2 vector
$CE–$CFLAB_CE/CFTC/CNTR code vector

Download Full Annotated Source →