Add MON85 Version 1.2 original files from Roman Borik
authorSergey Kiselev <skiselev@gmail.com>
Wed, 22 Sep 2021 19:22:18 +0000 (12:22 -0700)
committerSergey Kiselev <skiselev@gmail.com>
Wed, 22 Sep 2021 19:22:18 +0000 (12:22 -0700)
Signed-off-by: Sergey Kiselev <skiselev@gmail.com>
software/mon85/mon85-v12-ncb85.asm [new file with mode: 0644]
software/mon85/mon85-v12-ncb85.bin [new file with mode: 0644]
software/mon85/mon85-v12-ncb85.hex [new file with mode: 0644]
software/mon85/mon85-v12-ncb85.lst [new file with mode: 0644]
software/mon85/mon85-v12.txt [new file with mode: 0644]
software/mon85/mon85.txt [new file with mode: 0644]

diff --git a/software/mon85/mon85-v12-ncb85.asm b/software/mon85/mon85-v12-ncb85.asm
new file mode 100644 (file)
index 0000000..e9ee859
--- /dev/null
@@ -0,0 +1,1773 @@
+;\r
+; MON85: A software debugger for the 8080/8085 processor\r
+;\r
+; Copyright 1979-2007 Dave Dunfield\r
+; All rights reserved.\r
+;\r
+; Version 1.2 - 2012 Roman Borik\r
+;\r
+; New in version 1.2\r
+; - Support for undocumented 8085 instructions.\r
+;   DSUB B, ARHL, RDEL, LDHI d8, LDSI d8, LHLX D, SHLX D, JNK a16, JK a16, RSTV\r
+; - Command R displays all flags of F register (SZKA3PVC). If flag is not set\r
+;   dash '-' is displayed.\r
+; - Added restart vector RST 8 (0040h) for possibility to handle RSTV call.\r
+; - Changed TRACE mode. After entering TRACE mode, instruction on actual PC and\r
+;   content of registers (if it is switched on) are displayed.\r
+;   Entering a space ' ' executes this instruction, and returns to the 'T>'\r
+;   prompt with the next instruction.\r
+; - Instructions LXI, DAD, INX, DCX displays argument 'SP' rather than 'S'.\r
+; - Commands that requires 1 byte parameter raises error if entered value\r
+;   not fit to 1 byte.\r
+; - Command 'C' checks overlap of source and destination block and for copying\r
+;   uses appropriate direction.\r
+; - Command 'F' checks <start> and <end> parameters and raises error,\r
+;   if <end> is lower than <start>.\r
+; - Added command 'H' to send out memory content in Intel HEX format.\r
+; - Sending of LF and CR characters were reversed and are sent in the usual\r
+;   order - CR first and followed by LF.\r
+\r
+\r
+ROM    EQU     0000h           ; Debugger goes here\r
+DRAM   EQU     0FFA0h          ; Debugger RAM (96 bytes required)\r
+\r
+;\r
+; Debugger data area (in RAM)\r
+;\r
+       ORG     DRAM            ; Monitor data goes here\r
+;\r
+UBASE: DS      2               ; Base address of user program\r
+HL:    DS      2               ; Saved HL register pair\r
+DE:    DS      2               ; Saved DE register pair\r
+BC:    DS      2               ; Saved BC register pair\r
+PSW:   DS      2               ; Saved PSW (A + CC)\r
+SP:    DS      2               ; Saved Stack Pointer\r
+PC:    DS      2               ; Saved Program Counter\r
+OFLAG: DS      1               ; Output suspended flag\r
+TFLAG: DS      1               ; Flag to enable TRACING\r
+SFLAG: DS      1               ; Flag to enable SUBROUTINE tracing\r
+AFLAG: DS      1               ; Flag to enable AUTO REGISTER DISPLAY\r
+BRKTAB:        DS      24              ; Breakpoint table\r
+INST:  DS      6               ; Save area for "faking" instructions\r
+BUFFER:        DS      48              ; Input/temp buffer & stack\r
+DSTACK EQU     $&0FFFFh        ; Debugger stack\r
+;\r
+; Startup code... Kick off the monitor\r
+;\r
+       ORG     ROM             ; Debugger code goes here\r
+;\r
+       LXI     SP,DSTACK       ; Set up initial stack pointer\r
+       JMP     TEST            ; Execute main program\r
+       DS      2               ; Filler bytes to first int\r
+;\r
+; Interrupt handlers for RESTART interrupts\r
+;\r
+; Although they RST 1.5, 2.5 and 3.5 vectors are not used by the\r
+; 8085 hardware,  they are included since the space must contain\r
+; SOMETHING,  and who knows,  perhaps someone uses them for jump\r
+; table addresses etc...\r
+;\r
+; Restart 1 is the entry point for breakpoints\r
+RST1:  JMP     ENTRY           ; Execute handler\r
+       DS      1               ; Filler to next int\r
+RST15: CALL    RSTINT          ; Invoke interrupt\r
+       DB      12              ; Offset to handler\r
+RST2:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      16              ; Offset to handler\r
+RST25: CALL    RSTINT          ; Invoke interrupt\r
+       DB      20              ; Offset to handler\r
+RST3:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      24              ; Offset to handler\r
+RST35: CALL    RSTINT          ; Invoke interrupt\r
+       DB      28              ; Offset to handler\r
+RST4:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      32              ; Offset to handler\r
+TRAP:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      36              ; Offset to handler\r
+RST5:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      40              ; Offset to handler\r
+RST55: CALL    RSTINT          ; Invoke interrupt\r
+       DB      44              ; Offset to handler\r
+RST6:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      48              ; Offset to handler\r
+RST65: CALL    RSTINT          ; Invoke interrupt\r
+       DB      52              ; Offset to handler\r
+RST7:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      56              ; Offset to handler\r
+RST75: CALL    RSTINT          ; Invoke interrupt\r
+       DB      60              ; Offset to handler\r
+RST8:  CALL    RSTINT          ; Invoke interrupt\r
+       DB      64              ; Offset to handler\r
+;\r
+; Process a RESTART interrupt, get offset & vector to code\r
+; To speed processing, it is assumed that the user program\r
+; base address begins on a 256 byte page boundary.\r
+;\r
+RSTINT:        XTHL                    ; Save HL, Get PTR to offset\r
+       PUSH    PSW             ; Save A and CC\r
+       MOV     A,M             ; Get offset\r
+       LHLD    UBASE           ; Get high of user program\r
+       MOV     L,A             ; Set low address\r
+       POP     PSW             ; Restore A & CC\r
+       XTHL                    ; Restore HL, set \r
+       RET                     ; Vector to interrupt\r
+;\r
+; Register -> text translation tables used by the disassembler. These tables\r
+; go here (near beginning) so that we can be sure the high address will not\r
+; cross a page boundary allowing us to index by modifying low address only.\r
+;\r
+RTAB:  DB      "BCDEHLMA"      ; Table of register names\r
+RPTAB: DB      "BDHS"          ; Table of register pairs\r
+;\r
+; Entry point for breakpoints & program tracing\r
+;\r
+; Save the user program registers\r
+ENTRY: SHLD    HL              ; Save HL\r
+       XCHG                    ; Get DE\r
+       SHLD    DE              ; Save DE\r
+       POP     H               ; Get RET addrss\r
+       SHLD    PC              ; Save PC\r
+       PUSH    B               ; Copy BC\r
+       POP     H               ; And get it\r
+       SHLD    BC              ; Save PC\r
+       PUSH    PSW             ; Copy PSW\r
+       POP     H               ; And get it\r
+       SHLD    PSW             ; Save PSW\r
+       LXI     H,0             ; Start with zero\r
+       DAD     SP              ; Get SP\r
+       SHLD    SP              ; Save SP\r
+       LXI     SP,DSTACK       ; Move to our stack\r
+       LHLD    PC              ; Get RET addrss\r
+       DCX     H               ; Backup to actual instruction\r
+       SHLD    PC              ; Save PC\r
+       LXI     D,BRKTAB        ; Point to breakpoint table\r
+       MVI     B,'0'           ; Assume breakpoint #0\r
+; Search breakpoint table & see if this is a breakpoint\r
+TRYBRK:        LDAX    D               ; Get HIGH byte from table\r
+       INX     D               ; Advance\r
+       CMP     H               ; Does it match?\r
+       LDAX    D               ; Get LOW byte from table\r
+       INX     D               ; Advance\r
+       JNZ     NOTBRK          ; No, try next\r
+       CMP     L               ; Does it match?\r
+       JZ      FOUND           ; Yes, we have an entry\r
+NOTBRK:        INX     D               ; Skip saved code byte\r
+       INR     B               ; Advance breakpoint number\r
+       MOV     A,B             ; Get breakpoint number\r
+       CPI     '0'+8           ; Table exausted\r
+       JC      TRYBRK          ; No, keep looking\r
+; This interrupt is NOT a breakpoint\r
+       JMP     NOBK            ; Enter with no breakpoint\r
+; This interrupt is a breakpoint, display the message\r
+FOUND: CALL    PRTMSG          ; Output message\r
+       DB      "** Breakpoint ",0\r
+       MOV     A,B             ; Get breakpoint number\r
+       CALL    OUT             ; Output it\r
+       CALL    CRLF            ; New line\r
+; Reenter monitor, first, restore all breakpoint opcodes\r
+NOBK:  LXI     H,BRKTAB        ; Point to breakpoint table\r
+       MVI     B,8             ; 8 breakpoints\r
+FIXL:  MOV     D,M             ; Get HIGH address\r
+       INX     H               ; Advance\r
+       MOV     E,M             ; Get LOW address\r
+       INX     H               ; Advance\r
+       MOV     A,D             ; Get high\r
+       ORA     E               ; Test for ZERO\r
+       JZ      NOFIX           ; Breakpoint is not set\r
+       MOV     A,M             ; Get opcode\r
+       STAX    D               ; And patch user code\r
+NOFIX: INX     H               ; Skip opcode\r
+       DCR     B               ; Reduce count\r
+       JNZ     FIXL            ; Not finished, keep going\r
+       LDA     TFLAG           ; Get trace mode flag\r
+       ANA     A               ; Is it enabled?\r
+       JNZ     TRTB            ; Yes, enter trace mode\r
+       LDA     AFLAG           ; Get auto register display flag\r
+       ANA     A               ; Is it enabled?\r
+       CNZ     REGDIS          ; Yes, display the registers\r
+       JMP     REST            ; Enter monitor\r
+; Prompt for and handle trace mode commands\r
+TRTB:  CALL    PRTMSG          ; Output message\r
+       DB      "T> ",0         ; Trace mode prompt\r
+       LHLD    PC              ; Get PC\r
+       XCHG                    ; Move to DE\r
+       CALL    DINST           ; Disassemble the instruction\r
+       CALL    CRLF            ; New line\r
+       LDA     AFLAG           ; Get auto register display flag\r
+       ANA     A               ; Is it enabled?\r
+       CNZ     REGDIS          ; Yes, display the registers\r
+TRL:   CALL    INCHR           ; Get a command character\r
+       CPI     ' '             ; Execute command?\r
+       JZ      NOADR           ; Yes, handle it\r
+       CPI     1Bh             ; ESCAPE?\r
+       JZ      RECR            ; Yes, abort\r
+       CPI     '?'             ; Register display?\r
+       JNZ     TRL             ; No, ignore it\r
+       CALL    REGDIS          ; Display the registers\r
+       JMP     TRTB            ; And go again\r
+;\r
+; Main entry point for the 8080 debugger\r
+;\r
+TEST:  CALL    INIT            ; Set up hardware\r
+       CALL    PRTMSG          ; Output herald message\r
+       DB      0Dh,0Ah\r
+       DB      "MON85 Version 1.2"\r
+       DB      0Dh,0Ah,0Ah\r
+       DB      "Copyright 1979-2007 Dave Dunfield"\r
+       DB      0Dh,0Ah\r
+       DB      "2012 Roman Borik"\r
+       DB      0Dh,0Ah\r
+       DB      "All rights reserved."\r
+       DB      0Ah,0\r
+       LXI     H,UBASE         ; Point to start of reserved RAM\r
+       MVI     C,(DSTACK-UBASE)&0FFh ; Number of bytes to zero\r
+INIL1: MVI     M,0             ; Clear a byte\r
+       INX     H               ; Advance\r
+       DCR     C               ; Reduce count\r
+       JNZ     INIL1           ; Clear em all\r
+       LXI     H,0FFFFh        ; Set flags\r
+       SHLD    SFLAG           ; Turn on SUBTRACE & AUTOREG\r
+       LXI     H,UBASE         ; Default user stack (below monitor RAM)\r
+       SHLD    SP              ; Set user SP\r
+; Newline and prompt for command\r
+RECR:  CALL    CRLF            ; Output a newline\r
+; Prompt for an input command\r
+REST:  LXI     SP,DSTACK       ; Reset stack pointer\r
+       CALL    PRTMSG          ; Output message\r
+       DB      "C> ",0         ; Command prompt\r
+       CALL    INPT            ; Get command character\r
+; Look up command in table\r
+       MOV     B,A             ; Save for later\r
+       LXI     H,CTABLE        ; Point to command table\r
+REST1: MOV     A,M             ; Get char\r
+       INX     H               ; Advance\r
+       CMP     B               ; Do it match?\r
+       JZ      REST2           ; Yes, go for it\r
+       INX     H               ; Skip HIGH address\r
+       INX     H               ; Skip LOW address\r
+       ANA     A               ; end of table?\r
+       JNZ     REST1           ; Its OK\r
+; Error has occured, issue message & return for command\r
+ERROR: MVI     A,'?'           ; Error indicator\r
+       CALL    OUT             ; Display\r
+       JMP     RECR            ; And wait for command\r
+; We have command, execute it\r
+REST2: INX     D               ; Skip command character\r
+       MOV     A,M             ; Get low address\r
+       INX     H               ; Skip to next\r
+       MOV     H,M             ; Get HIGH address\r
+       MOV     L,A             ; Set LOW\r
+       CALL    SKIP            ; Set 'Z' of no operands\r
+       PCHL                    ; And execute\r
+; Table of commands to execute\r
+CTABLE:        DB      'A'             ; Set AUTOREG flag\r
+       DW      AUTO\r
+       DB      'B'             ; Set/Display breakpoint\r
+       DW      SETBRK\r
+       DB      'C'             ; Copy memory\r
+       DW      COPY\r
+       DB      'D'             ; Disassemble\r
+       DW      GODIS\r
+       DB      'E'             ; Edit memory\r
+       DW      EDIT\r
+       DB      'F'             ; Fill memory\r
+       DW      FILL\r
+       DB      'G'             ; Go (begin execution)\r
+       DW      GO\r
+       DB      'H'             ; Send out memory as Intel HEX\r
+       DW      SNDHEX\r
+       DB      'I'             ; Input from port\r
+       DW      INPUT\r
+       DB      'L'             ; Load from serial port\r
+       DW      LOAD\r
+       DB      'M'             ; Memory display\r
+       DW      MEMRY\r
+       DB      'O'             ; Output to port\r
+       DW      OUTPUT\r
+       DB      'R'             ; Set/Display Registers\r
+       DW      REGIST\r
+       DB      'S'             ; Set SUBTRACE flag\r
+       DW      SUBON\r
+       DB      'T'             ; Set TRACE mode\r
+       DW      TRACE\r
+       DB      'U'             ; Set/Display user base\r
+       DW      USRBASE\r
+       DB      '?'             ; Help command\r
+       DW      HELP\r
+       DB      0               ; End of table\r
+       DW      REST            ; Handle NULL command\r
+;\r
+; Help command\r
+;\r
+HELP:  LXI     H,HTEXT         ; Point to help text\r
+       SUB     A               ; Get a zero\r
+       STA     OFLAG           ; Clear the output flag\r
+; Output each line\r
+HELP1: MVI     C,25            ; Column counter\r
+HELP2: MOV     A,M             ; Get character\r
+       INX     H               ; Advance to next\r
+       ANA     A               ; End of line?\r
+       JZ      HELP4           ; Yes, terminate\r
+       CPI     '!'             ; Separator?\r
+       JZ      HELP3           ; Yes, output\r
+       CALL    OUT             ; Write character\r
+       DCR     C               ; Reduce count\r
+       JMP     HELP2           ; Keep going\r
+; Fill with spaces to discription column\r
+HELP3: CALL    SPACE           ; Output a space\r
+       DCR     C               ; Reduce count\r
+       JNZ     HELP3           ; Do them all\r
+       MVI     A,'-'           ; Spperator\r
+       CALL    OUT             ; Display\r
+       CALL    SPACE           ; And space over\r
+       JMP     HELP2           ; Output rest of line\r
+; End of line encountered...\r
+HELP4: CALL    CHKSUS          ; New line\r
+       MOV     A,M             ; Get next byte\r
+       ANA     A               ; End of text?\r
+       JNZ     HELP1           ; Do them all\r
+       JMP     RECR            ; And go home\r
+;\r
+; Input from port\r
+;\r
+INPUT: CALL    CALC8           ; Get port number\r
+       MVI     A,0DBh          ; 'IN' instruction\r
+       MVI     H,0C9h          ; 'RET' instruction\r
+       STA     INST            ; Set RAM instruction\r
+       SHLD    INST+1          ; Set RAM instruction\r
+       CALL    PRTMSG          ; Output message\r
+       DB      "DATA=",0\r
+       CALL    INST            ; Perform the read\r
+       CALL    HPR             ; Output it\r
+       JMP     RECR            ; Newline & EXIT\r
+;\r
+; Output to port\r
+;\r
+OUTPUT:        CALL    CALC8           ; Get port number\r
+       MVI     A,0D3h          ; 'OUT' instruction\r
+       MVI     H,0C9h          ; 'RET' instruction\r
+       STA     INST            ; Set RAM instruction\r
+       SHLD    INST+1          ; Set RAM instruction\r
+       CALL    CALC8           ; Get data byte\r
+       CALL    INST            ; Output the data\r
+       JMP     REST            ; Back to command prompt\r
+;\r
+; Set breakpoint command\r
+;\r
+SETBRK:        JZ      DISBRK          ; No operands, display breakpoints\r
+; Set a breakpoint\r
+       CALL    CALC8           ; Get hex operand\r
+       CPI     8               ; In range?\r
+       JNC     ERROR           ; No, invalud\r
+       LXI     H,BRKTAB-3      ; Point to breakpoint table\r
+       LXI     B,3             ; Offset for a breakpoint\r
+SBRLP: DAD     B               ; Advance to next breakpoint\r
+       DCR     A               ; Reduce count\r
+       JP      SBRLP           ; Go until we are there\r
+       PUSH    H               ; Save table address\r
+       CALL    CALC            ; Get address\r
+       POP     D               ; Restore address\r
+       XCHG                    ; D=brkpt address, H=table address\r
+       MOV     M,D             ; Set HIGH address in table\r
+       INX     H               ; Advance\r
+       MOV     M,E             ; Set LOW address in table\r
+       INX     H               ; Advance\r
+       LDAX    D               ; Get opcode from memory\r
+       MOV     M,A             ; Save in table\r
+       JMP     REST            ; And get next command\r
+; Display breakpoints\r
+DISBRK:        LXI     D,BRKTAB        ; Point to breakpoint table\r
+       MVI     B,'0'           ; Begin with breakpoint zero\r
+DISLP: MVI     A,'B'           ; Lead in character\r
+       CALL    OUT             ; Output\r
+       MOV     A,B             ; Get breakpoint number\r
+       CALL    OUT             ; Output\r
+       MVI     A,'='           ; Seperator character\r
+       CALL    OUT             ; Output\r
+       LDAX    D               ; Get HIGH address\r
+       MOV     H,A             ; Copy\r
+       INX     D               ; Advance\r
+       LDAX    D               ; Get LOW address\r
+       MOV     L,A             ; Copy\r
+       ORA     H               ; Is breakpoint set?\r
+       JZ      NOTSET          ; No, don't display\r
+       CALL    HLOUT           ; Output in hex\r
+       JMP     GIVLF           ; And proceed\r
+; Breakpoint is not set\r
+NOTSET:        CALL    PRTMSG          ; Output message\r
+       DB      "****",0        ; Indicate not set\r
+GIVLF: MVI     A,' '           ; Get a space\r
+       CALL    OUT             ; Output\r
+       CALL    OUT             ; Output\r
+       MOV     A,B             ; Get breakpoint address\r
+       CPI     '0'+3           ; Halfway through?\r
+       CZ      CRLF            ; Yes, new line\r
+       INX     D               ; Skip low byte\r
+       INX     D               ; Skip opcode\r
+       INR     B               ; Advance breakpoint number\r
+       MOV     A,B             ; Get number again\r
+       CPI     '0'+8           ; All done?\r
+       JC      DISLP           ; No, keep going\r
+       CALL    CRLF            ; New line\r
+       LXI     H,AUTMSG        ; Message for AFLAG\r
+       LDA     AFLAG           ; Get flag state\r
+       CALL    DISON           ; Display ON/OFF indication\r
+       LXI     H,SUBMSG        ; Message for SFLAG\r
+       LDA     SFLAG           ; Get flag state\r
+       CALL    DISON           ; Display ON/OFF indication\r
+       LXI     H,TRCMSG        ; Message for TFLAG\r
+       LDA     TFLAG           ; Get flag state\r
+       CALL    DISON           ; Display ON/OFF indication\r
+       CALL    CRLF            ; New line\r
+       JMP     REST            ; Back for another command\r
+; Display ON/OFF flag state\r
+DISON: PUSH    PSW             ; Save A\r
+       CALL    PRTSTR          ; Output message\r
+       POP     PSW             ; Restore A\r
+       LXI     H,OFF           ; Assume OFF\r
+       ANA     A               ; Test A\r
+       JZ      PRTSTR          ; Yes, display OFF\r
+       LXI     H,ON            ; Convert to ON\r
+       JMP     PRTSTR          ; And display ON\r
+;\r
+; GO command, Begin program execution\r
+;\r
+GO:    JZ      NOHEX           ; Address not given, assume default\r
+       CALL    CALC            ; Get argument\r
+       SHLD    PC              ; Save new PC value\r
+NOHEX: LDA     TFLAG           ; Get trace flag\r
+       ANA     A               ; Enabled?\r
+       JNZ     TRTB            ; Yes, wait for prompt\r
+; Single-step one instruction...\r
+; Used for first instruction even when NOT tracing, so\r
+; that we can insert breakpoints\r
+NOADR: SUB     A               ; Get NOP\r
+       MOV     H,A             ; Set high\r
+       MOV     L,A             ; Set LOW\r
+       STA     INST            ; Set first byte\r
+       SHLD    INST+1          ; Set second & third\r
+       LHLD    PC              ; Get PC\r
+       XCHG                    ; Set DE to PC\r
+       CALL    LOOK            ; Lookup instruction\r
+       MOV     B,A             ; Save the TYPE/LENGTH byte\r
+       ANI     03h             ; Mask TYPE, save LENGTH\r
+       MOV     C,A             ; Save for count\r
+; Copy instruction into "faking" area\r
+       LXI     H,INST          ; Point to saved instruction\r
+GOSET: LDAX    D               ; Get byte from code\r
+       MOV     M,A             ; Save in instruction\r
+       INX     H               ; Advance output\r
+       INX     D               ; Advance input\r
+       DCR     C               ; Reduce count\r
+       JNZ     GOSET           ; Copy it all\r
+       XCHG                    ; HL = addrss to execute\r
+       MVI     A,0C3h          ; Get a JMP instruction\r
+       STA     INST+3          ; Set up a JUMP instruction\r
+       SHLD    INST+4          ; Set target address\r
+       LDA     TFLAG           ; Get trace flag\r
+       ANA     A               ; Are we tracing?\r
+       JZ      NOTRC           ; No, we are not\r
+       PUSH    B               ; Save TYPE/LENGTH\r
+       LHLD    INST+4          ; Get termination address\r
+       INX     H               ; Skip this one\r
+       SHLD    BUFFER          ; Save for "fake" handling\r
+       LXI     H,FAKE          ; Point to FAKE routine\r
+       SHLD    INST+4          ; Save new addres\r
+       POP     B               ; Restore TYPE/LENGTH\r
+; Simulate any control transfer instruction\r
+       LDA     INST            ; Get instruction\r
+       CPI     0E9h            ; Is it PCHL?\r
+       JNZ     NOPCHL          ; No, skip\r
+       LHLD    HL              ; Get user HL value\r
+       JMP     HLJMP           ; And simulate a jump\r
+NOPCHL:        CPI     0CBh            ; Is it RSTV?\r
+       JNZ     NORSTV          ; No, skip\r
+       LDA     PSW             ; Get status flags\r
+       ANI     2               ; Check V flag\r
+       JNZ     NOTRC           ; Is set, execute instruction\r
+       STA     INST            ; Change to NOP\r
+       JMP     NOTRC           ; Not set, execute NOP\r
+NORSTV:        CPI     0DDh            ; Is it JNK?\r
+       JZ      JNKJK           ; Yes, go\r
+       CPI     0FDh            ; Is it JK?\r
+       JNZ     NOJNK           ; No, skip\r
+JNKJK: ANI     20h             ; Save K flag from instruction code\r
+       MOV     C,A\r
+       LDA     PSW             ; Get status flags\r
+       ANI     20h             ; Save only K flag\r
+       XRA     C               ; Compare them\r
+       JZ      NOPSH           ; If they are equal, make jump\r
+       JMP     NOTRC           ; No jump \r
+NOJNK: MOV     A,B             ; Get TYPE back\r
+       CPI     0Bh             ; Is it a 'JUMP'\r
+       JZ      GOJMP           ; Yes, handle it\r
+       CPI     05h             ; Is it a 'RETURN'\r
+       JZ      CALRET          ; Yes, handle it\r
+       ANI     0F8h            ; Save only conditional bits\r
+       JZ      NOTRC           ; Not conditional, always execute instruction\r
+       ANI     08h             ; Does this test require COMPLEMENTED flags\r
+       LDA     PSW             ; Get status flags\r
+       JZ      NOCOM           ; No need to complement\r
+       CMA                     ; Invert for NOT tests\r
+NOCOM: MOV     C,A             ; Save PSW bits\r
+       MOV     A,B             ; Get conditon back\r
+       RAL                     ; Is it SIGN flag?\r
+       JC      SIGN            ; Yes, handle it\r
+       RAL                     ; Is it ZERO flag?\r
+       JC      ZERO            ; Yes, handle it\r
+       RAL                     ; Is it PARITY flag?\r
+       JC      PARITY          ; Yes, handle it\r
+; This instruction is conditional on the CARRY flag\r
+CARRY: MOV     A,C             ; Get flag bits\r
+       ANI     01h             ; Test CARRY flag\r
+       JMP     ENFLG           ; And proceed\r
+; This instruction is conditional on the SIGN flag\r
+SIGN:  MOV     A,C             ; Get flag bits\r
+       ANI     80h             ; Test SIGN flag\r
+       JMP     ENFLG           ; And proceed\r
+; This instruction is conditional on the ZERO flag\r
+ZERO:  MOV     A,C             ; Get flag bits\r
+       ANI     40h             ; Test ZERO flag\r
+       JMP     ENFLG           ; And proceed\r
+; This instruction is conditional on the PARITY flag\r
+PARITY:        MOV     A,C             ; Get flag bits\r
+       ANI     04h             ; Test PARITY flag\r
+; Execute conditional instruction\r
+ENFLG: JZ      NOTRC           ; Not executed\r
+       MOV     A,B             ; Get type back\r
+       ANI     04h             ; Is it JUMP\r
+       JNZ     CALRET          ; No, try next\r
+; Simulate a JUMP instruction\r
+GOJMP: LDA     INST            ; Get instruction\r
+       CPI     0CDh            ; Is it a CALL\r
+       JZ      PADR            ; Yes\r
+       ANI     0C7h            ; Mask conditional\r
+       CPI     0C4h            ; Conditional call?\r
+       JNZ     NOPSH           ; No, its a jump\r
+; Simulate a subroutine trace\r
+PADR:  LDA     SFLAG           ; Get subroutine tracing flag\r
+       ANA     A               ; Is it set?\r
+       JZ      NOTRC           ; No, simulate as one instruction\r
+       LHLD    BUFFER          ; Get termination address\r
+       DCX     H               ; Backup\r
+       XCHG                    ; D = address\r
+       LHLD    SP              ; Get user SP\r
+       DCX     H               ; Backup\r
+       MOV     M,D             ; Set HIGH return address\r
+       DCX     H               ; Backup\r
+       MOV     M,E             ; Set LOW return address\r
+       SHLD    SP              ; Resave user SP\r
+; Continue simulation of a JUMP type instruction\r
+NOPSH: LHLD    INST+1          ; Get target address\r
+       JMP     HLJMP           ; And proceed\r
+; Handle simulation of RETURN instruction\r
+CALRET:        LHLD    SP              ; Get sser SP\r
+       MOV     E,M             ; Get LOW return address\r
+       INX     H               ; Advance\r
+       MOV     D,M             ; Get HIGH return address\r
+       INX     H               ; Advance\r
+       SHLD    SP              ; Resave user SP\r
+       XCHG                    ; Set HL = address\r
+; Simulate a jump to the address in HL\r
+HLJMP: INX     H               ; Advance\r
+       SHLD    BUFFER          ; Save new target address\r
+       SUB     A               ; Get NOP\r
+       MOV     H,A             ; Set HIGH\r
+       MOV     L,A             ; Set LOW\r
+       STA     INST            ; NOP first byte\r
+       SHLD    INST+1          ; NOP second byte\r
+; Dispatch the user program\r
+; First, insert any breakpoints into the object code\r
+NOTRC: LXI     D,BRKTAB        ; Point to breakpoint table\r
+       MVI     C,8             ; Size of table (in entries)\r
+RESBP: LDAX    D               ; Get a HIGH address\r
+       MOV     H,A             ; Save for later\r
+       INX     D               ; Advance\r
+       LDAX    D               ; Get low address\r
+       MOV     L,A             ; Save for later\r
+       INX     D               ; Advance\r
+       ORA     H               ; Is breakpoint enabled?\r
+       JZ      NORES           ; No, its not\r
+       MVI     M,0CFh          ; Set up a RST 1 breakpoint\r
+NORES: INX     D               ; Skip opcode\r
+       DCR     C               ; Reduce count\r
+       JNZ     RESBP           ; Do them all\r
+; Restore the user applications registers\r
+       LHLD    SP              ; Get stack pointer\r
+       SPHL                    ; Set stack pointer\r
+       LHLD    BC              ; Get BC\r
+       PUSH    H               ; Save\r
+       POP     B               ; And set\r
+       LHLD    PSW             ; Get PSW\r
+       PUSH    H               ; Save\r
+       POP     PSW             ; And set\r
+       LHLD    DE              ; Get DE\r
+       XCHG                    ; Set DE\r
+       LHLD    HL              ; Get HL\r
+       JMP     INST            ; Execute "faked" instruction\r
+; Trace routine: simulate a breakpoint interrupt\r
+FAKE:  PUSH    H               ; Save HL on stack\r
+       LHLD    BUFFER          ; Get address to execute\r
+       XTHL                    ; Restore HL, [SP] = address\r
+       JMP     ENTRY           ; Display the registers\r
+;\r
+; Display/Change registers\r
+;\r
+REGIST:        JNZ     CHG1            ; Register name to change is given\r
+; Display registers\r
+       CALL    REGDIS          ; Display registers\r
+       JMP     REST            ; And exit\r
+; Set register value\r
+CHG1:  MOV     B,A             ; Save first register name char\r
+       CALL    GETCHI          ; Get char (in upper case)\r
+       MOV     C,A             ; Save for later\r
+       JZ      OKCH            ; End of string\r
+; Drop extra characters incase 'PSW'\r
+CHG2:  CALL    GETCHR          ; Get next\r
+       JNZ     CHG2            ; Clean them out\r
+; Get new value for register\r
+OKCH:  CALL    CALC            ; Get new value\r
+       MOV     A,B             ; Get first char\r
+       CPI     'H'             ; Is it HL pair\r
+       JNZ     CDE             ; No, try next\r
+       SHLD    HL              ; Set HL value\r
+       JMP     REST            ; And proceed\r
+CDE:   CPI     'D'             ; Is it DE pair?\r
+       JNZ     CBC             ; No, try next\r
+       SHLD    DE              ; Set DE value\r
+       JMP     REST            ; And proceed\r
+CBC:   CPI     'B'             ; Is it BC pair?\r
+       JNZ     CSP             ; No, try next\r
+       SHLD    BC              ; Set BC value\r
+       JMP     REST            ; And proceed\r
+CSP:   CPI     'S'             ; Is it SP?\r
+       JNZ     CP              ; No, try next\r
+       SHLD    SP              ; Set SP value\r
+       JMP     REST            ; And proceed\r
+CP:    CPI     'P'             ; Is it PS or PC\r
+       JNZ     ERROR           ; No, error\r
+       MOV     A,C             ; Get low character\r
+       CPI     'S'             ; Is it PSW?\r
+       JNZ     CPC             ; No, try next\r
+       SHLD    PSW             ; Set new PSW\r
+       JMP     REST            ; And proceed\r
+CPC:   CPI     'C'             ; Is it PC?\r
+       JNZ     ERROR           ; No, error\r
+       SHLD    PC              ; Set new PC\r
+       JMP     REST            ; And proceed\r
+; Process an ON/OFF operand\r
+ONOFF: CALL    SKIP            ; Get next char\r
+       CPI     'O'             ; Must begin with ON\r
+       JNZ     ERROR           ; Invalid\r
+       CALL    GETCHI          ; Get next char\r
+       MVI     B,0             ; Assume OFF\r
+       CPI     'F'             ; OFF?\r
+       JZ      RETON           ; Yes, set it\r
+       CPI     'N'             ; ON?\r
+       JNZ     ERROR           ; No, error\r
+       DCR     B               ; Convert to FF\r
+RETON: MOV     A,B             ; Save new value\r
+       RET\r
+;\r
+; Turn automatic register display ON or OFF\r
+;\r
+AUTO:  CALL    ONOFF           ; Get ON/OFF value\r
+       STA     AFLAG           ; Set AUTOREG flag\r
+       JMP     REST            ; And proceed\r
+;\r
+; Turn SUBROUTINE tracing ON or OFF\r
+;\r
+SUBON: CALL    ONOFF           ; Get ON/OFF value\r
+       STA     SFLAG           ; Set SUBTRACE flag\r
+       JMP     REST            ; And proceed\r
+;\r
+; Set TRACE mode ON or OFF\r
+;\r
+TRACE: CALL    ONOFF           ; Get ON/OFF value\r
+       STA     TFLAG           ; Set TRACE flag\r
+       JMP     REST            ; And proceed\r
+;\r
+; Edit memory contents\r
+;\r
+EDIT:  CALL    CALC            ; Get address\r
+EDIT1: CALL    HLOUT           ; Display address\r
+       CALL    SPACE           ; Separator\r
+       MOV     A,M             ; Get contents\r
+       CALL    HPR             ; Output\r
+       MVI     A,'='           ; Prompt\r
+       CALL    OUT             ; Output\r
+       PUSH    H               ; Save address\r
+       CALL    INPT            ; Get a value\r
+       POP     H               ; Restore address\r
+       INX     H               ; Assume advance\r
+       JZ      EDIT1           ; Null, advance\r
+       DCX     H               ; Fix mistake\r
+       DCX     H               ; Assume backup\r
+       CPI     '-'             ; Backup?\r
+       JZ      EDIT1           ; Yes, backup a byte\r
+       INX     H               ; Fix mistake\r
+       CPI     27h             ; Single quote?\r
+       JNZ     EDIT3           ; No, try hex value\r
+; Handle quoted ASCII text\r
+       INX     D               ; Skip the quote\r
+EDIT2: LDAX    D               ; Get char\r
+       INX     D               ; Advance input\r
+       ANA     A               ; End of loop?\r
+       JZ      EDIT1           ; Yes, exit\r
+       MOV     M,A             ; Save it\r
+       INX     H               ; Advance output\r
+       JMP     EDIT2           ; And proceed\r
+; Handle HEXIDECIMAL values\r
+EDIT3: PUSH    H               ; Save address\r
+       CALL    CALC8           ; Get HEX value\r
+       POP     H               ; HL = address\r
+       MOV     M,A             ; Set value\r
+       INX     H               ; Advance to next\r
+       CALL    SKIP            ; More operands?\r
+       JNZ     EDIT3           ; Get then all\r
+       JMP     EDIT1           ; And continue\r
+;\r
+; FIll memory with a value\r
+;\r
+FILL:  CALL    CALC            ; Get starting address\r
+       PUSH    H               ; Save for later\r
+       CALL    CALC            ; Get ending address\r
+       PUSH    H               ; Save for later\r
+       CALL    CALC8           ; Get value\r
+       MOV     C,A             ; C = value\r
+       POP     D\r
+       INX     D               ; DE = End address+1\r
+       POP     H               ; HL = Starting address\r
+       CALL    COMP16          ; Is Start<End ?\r
+       JNC     ERROR           ; Yes, bad entry\r
+FILL1: MOV     M,C             ; Save one byte\r
+       INX     H               ; Advance\r
+       CALL    COMP16          ; Test for match\r
+       JC      FILL1           ; And proceed\r
+       JMP     REST            ; Back for next\r
+;\r
+; 16 bit compare of HL to DE\r
+;\r
+COMP16:        MOV     A,H             ; Get HIGH\r
+       CMP     D               ; Match?\r
+       RNZ                     ; No, we are done\r
+       MOV     A,L             ; Get LOW\r
+       CMP     E               ; Match?\r
+       RET\r
+;\r
+; Copy a block of memory\r
+;\r
+COPY:  CALL    CALC            ; Get SOURCE address\r
+       PUSH    H               ; Save for later\r
+       CALL    CALC            ; Get DEST Address\r
+       PUSH    H               ; Save for later\r
+       CALL    CALC            ; Get size\r
+       MOV     B,H             ; BC = Size\r
+       MOV     C,L\r
+       POP     D               ; DE = Dest address\r
+       POP     H               ; HL = Source\r
+       MOV     A,B             ; Size is zero?\r
+       ORA     C\r
+       JZ      REST            ; Yes, exit\r
+       CALL    COMP16          ; Compare source and destination address\r
+       JC      COPY2           ; Dest > Source, jump\r
+       ; Source > Dest\r
+COPY1: MOV     A,M             ; Get byte from source\r
+       STAX    D               ; Write to dest\r
+       INX     H               ; Advance source\r
+       INX     D               ; Advance dest\r
+       DCX     B               ; Reduce count\r
+       MOV     A,C             ; Count is zero ?\r
+       ORA     B\r
+       JNZ     COPY1           ; No, continue\r
+       JMP     REST\r
+       ; Dest > Source\r
+COPY2: DAD     B               ; Move source and destination address to end\r
+       DCX     H               ; of block\r
+       XCHG\r
+       DAD     B\r
+       DCX     H\r
+COPY3: LDAX    D               ; Get byte from source\r
+       MOV     M,A             ; Write to dest\r
+       DCX     D               ; Decrement source address\r
+       DCX     H               ; Decrement destination address\r
+       DCX     B               ; Reduce count\r
+       MOV     A,C             ; Count is zero ?\r
+       ORA     B\r
+       JNZ     COPY3           ; No, continue\r
+       JMP     REST\r
+;\r
+; Display a block of memory\r
+;\r
+MEMRY: CALL    CALC            ; Get operand\r
+       SUB     A               ; Get a ZERO\r
+       STA     OFLAG           ; Clear output flag\r
+ALOOP: CALL    HLOUT2          ; Display address (in hex) with 2 spaces\r
+       MVI     D,16            ; 16 bytes/line\r
+       PUSH    H               ; Save address\r
+ALP1:  MOV     A,M             ; Get byte\r
+       CALL    HPR             ; Output in hex\r
+       CALL    SPACE           ; Space over\r
+       MOV     A,D             ; Get count\r
+       CPI     9               ; At boundary?\r
+       CZ      SPACE           ; Yes, extra space\r
+       MOV     A,D             ; Get count\r
+       ANI     7               ; Mask for low bits\r
+       CPI     5               ; At boundary?\r
+       CZ      SPACE           ; Extra space\r
+       INX     H               ; Advance address\r
+       DCR     D               ; Reduce count\r
+       JNZ     ALP1            ; Do them all\r
+       MVI     D,4             ; # separating spaces\r
+AL2:   CALL    SPACE           ; Output a space\r
+       DCR     D               ; Reduce count\r
+       JNZ     AL2             ; And proceed\r
+       POP     H\r
+       MVI     D,16            ; 16 chars/display\r
+AL3:   MOV     A,M             ; Get data byte\r
+       CALL    OUTP            ; Display (if printable)\r
+       INX     H               ; Advance to next\r
+       DCR     D               ; Reduce count\r
+       JNZ     AL3             ; Do them all\r
+       CALL    CHKSUS          ; Handle output suspension\r
+       JMP     ALOOP           ; And continue\r
+;\r
+; Perform disassembly to console\r
+;\r
+GODIS: CALL    CALC            ; Get starting address\r
+       PUSH    H               ; Save address\r
+       POP     D               ; Copy to D\r
+       SUB     A               ; Get a zero\r
+       STA     OFLAG           ; Clear output flag\r
+VLOOP: CALL    DINST           ; Display one instruction\r
+       CALL    CHKSUS          ; Handle output\r
+       JMP     VLOOP           ; And proceed\r
+;\r
+; Set/display user base address\r
+;\r
+USRBASE: JNZ   USRB1           ; Address is given, set it\r
+       CALL    PRTMSG          ; Output message\r
+       DB      "BASE=",0\r
+       LHLD    UBASE           ; Get address\r
+       CALL    HLOUT           ; Output\r
+       JMP     RECR            ; New line & exit\r
+USRB1: CALL    CALC            ; Get operand\r
+       SHLD    UBASE           ; Set the address\r
+       JMP     REST            ; and return\r
+;\r
+; Send out as Intel HEX\r
+;\r
+SNDHEX:        CALL    CALC            ; Get start address\r
+       PUSH    H               ; Save for later\r
+       CALL    CALC            ; Get end address\r
+       INX     H               ; HL = end+1\r
+       POP     D               ; DE = start\r
+       CALL    COMP16          ; Check for Start > End\r
+       JC      ERROR           ; Bad entry\r
+       MOV     A,L             ; Compute length\r
+       SUB     E\r
+       MOV     L,A\r
+       MOV     A,H\r
+       SBB     D\r
+       MOV     H,A\r
+       XCHG                    ; HL = start, DE = length\r
+SNDHX1:        MOV     A,D             ; Finish ?\r
+       ORA     E\r
+       JZ      SNDHX3          ; Yes, jump\r
+       MVI     B,16            ; 16 bytes per record\r
+       MOV     A,D             ; Is rest > 16 ?\r
+       ORA     A\r
+       JNZ     SNDHX2          ; No, jump\r
+       MOV     A,E\r
+       CMP     B\r
+       JNC     SNDHX2          ; No, jump\r
+       MOV     B,E             ; Yes, B=rest\r
+SNDHX2:        CALL    SHXRC           ; Send out one record\r
+       JMP     SNDHX1          ; continue\r
+;\r
+SNDHX3:        CALL    PRTMSG\r
+       DB      ":00000001FF",0Dh,0Ah,0\r
+       JMP     REST\r
+;\r
+SHXRC: MVI     A,':'           ; Start record\r
+       CALL    OUT\r
+       MOV     A,B             ; Length\r
+       MOV     C,A             ; Init checksum\r
+       CALL    HPR             ; Output in hex\r
+       MOV     A,H             ; High byte of address \r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+       MOV     A,H\r
+       CALL    HPR             ; Output in hex\r
+       MOV     A,L             ; Low byte of address \r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+       MOV     A,L\r
+       CALL    HPR             ; Output in hex\r
+       XRA     A               ; Record type\r
+       CALL    HPR\r
+SHXRC1:        MOV     A,M             ; One byte\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+       MOV     A,M\r
+       INX     H\r
+       CALL    HPR             ; Output in hex\r
+       DCX     D               ; Decrement main counter\r
+       DCR     B               ; Decrement bytes per record counter\r
+       JNZ     SHXRC1\r
+       MOV     A,C             ; Negate checksum\r
+       CMA\r
+       INR     A\r
+       CALL    HPR             ; Output in hex\r
+       JMP     CRLF\r
+;\r
+; Download command\r
+;\r
+LOAD:  MVI     A,0Fh           ; Get default initial state\r
+       JZ      LOAD1           ; Address not given...\r
+       CALL    CALC            ; Get operand value\r
+       SHLD    BUFFER+3        ; Save for later calulation\r
+       MVI     A,0FFh          ; Set new initial state\r
+; Setup the offset calculator\r
+LOAD1: LXI     H,0             ; Assume no offset\r
+       STA     BUFFER          ; Set mode flag\r
+       SHLD    BUFFER+1        ; Assume offset is ZERO\r
+; Download the records\r
+LOAD2: CALL    DLREC           ; Get a record\r
+       JNZ     DLBAD           ; Report error\r
+       JNC     LOAD2           ; Get them all\r
+       JMP     DLWAIT          ; And back to monitor\r
+; Error in receiving download record\r
+DLBAD: CALL    PRTMSG          ; Output message\r
+       DB      "?Load error"\r
+       DB      0Dh,0Ah,0\r
+; Wait till incoming data stream stops\r
+DLWAIT:        MVI     C,0             ; Initial count\r
+DLWAIT1: CALL  IN              ; Test for input\r
+       ANA     A               ; Any data\r
+       JNZ     DLWAIT          ; Reset count\r
+       DCR     C               ; Reduce counter\r
+       JNZ     DLWAIT1         ; Keep looking\r
+       JMP     REST            ; Back to monitor\r
+;\r
+; Download a record from the serial port\r
+;\r
+DLREC: CALL    INCHR           ; Read a character\r
+       CPI     ':'             ; Start of record?\r
+       JZ      DLINT           ; Download INTEL format\r
+       CPI     'S'             ; Is it MOTOROLA?\r
+       JNZ     DLREC           ; No, keep looking\r
+; Download a MOTOROLA HEX format record\r
+DLMOT: CALL    INCHR           ; Get next character\r
+       CPI     '0'             ; Header record?\r
+       JZ      DLREC           ; Yes, skip it\r
+       CPI     '9'             ; End of file?\r
+       JZ      DLEOF           ; Yes, report EOF\r
+       CPI     '1'             ; Type 1 (code) record\r
+       JNZ     DLERR           ; Report error\r
+       CALL    GETBYT          ; Get length\r
+       MOV     C,A             ; Start checksum\r
+       SUI     3               ; Convert for overhead\r
+       MOV     B,A             ; Save data length\r
+       CALL    GETBYT          ; Get first byte of address\r
+       MOV     H,A             ; Set HIGH address\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; And re-save\r
+       CALL    GETBYT          ; Get next byte of address\r
+       MOV     L,A             ; Set LOW address\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; And re-save\r
+       CALL    SETOFF          ; Handle record offsets\r
+DMOT1: CALL    GETBYT          ; Get a byte of data\r
+       MOV     M,A             ; Save in memory\r
+       INX     H               ; Advance\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; And re-save\r
+       DCR     B               ; Reduce length\r
+       JNZ     DMOT1           ; Keep going\r
+       CALL    GETBYT          ; Get record checksum\r
+       ADD     C               ; Include calculated checksum\r
+       INR     A               ; Adjust for test\r
+       ANA     A               ; Clear carry set Z\r
+       RET\r
+; Download a record in INTEL hex format\r
+DLINT: CALL    GETBYT          ; Get length\r
+       ANA     A               ; End of file?\r
+       JZ      DLEOF           ; Yes, handle it\r
+       MOV     C,A             ; Begin Checksum\r
+       MOV     B,A             ; Record length\r
+       CALL    GETBYT          ; Get HIGH address\r
+       MOV     H,A             ; Set HIGH address\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+       CALL    GETBYT          ; Get LOW address\r
+       MOV     L,A             ; Set LOW address\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+       CALL    SETOFF          ; Handle record offsets\r
+       CALL    GETBYT          ; Get type byte\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Re-save\r
+DLINT1:        CALL    GETBYT          ; Get data byte\r
+       MOV     M,A             ; Save in memory\r
+       INX     H               ; Advance to next\r
+       ADD     C               ; Include in checksum\r
+       MOV     C,A             ; Resave checksum\r
+       DCR     B               ; Reduce count\r
+       JNZ     DLINT1          ; Do entire record\r
+       CALL    GETBYT          ; Get record checksum\r
+       ADD     C               ; Add to computed checksum\r
+       ANA     A               ; Clear carry, set Z\r
+       RET\r
+; End of file on download\r
+DLEOF: STC                     ; Set carry, EOF\r
+       RET\r
+;\r
+; Process record offsets for download records\r
+;\r
+SETOFF:        LDA     BUFFER          ; Get flag\r
+       ANA     A               ; Test flag\r
+       JNZ     SETOF1          ; Special case\r
+; Not first record, adjust for offset & proceed\r
+       XCHG                    ; DE = address\r
+       LHLD    BUFFER+1        ; Get offset\r
+       DAD     D               ; HL = address + offset\r
+       RET\r
+; First record, set USER BASE & calculate offset (if any)\r
+SETOF1:        MVI     A,0             ; Get zero (NO CC)\r
+       STA     BUFFER          ; Clear flag\r
+       SHLD    UBASE           ; Set user program base\r
+       RP                      ; No more action\r
+; Calculate record offset to RAM area\r
+       XCHG                    ; DE = address\r
+       LHLD    BUFFER+3        ; Get operand\r
+       MOV     A,L             ; Subtract\r
+       SUB     E               ; Record\r
+       MOV     L,A             ; From\r
+       MOV     A,H             ; Operand\r
+       SBB     D               ; To get\r
+       MOV     H,A             ; Offset\r
+       SHLD    BUFFER+1        ; Set new offset\r
+       DAD     D               ; Get address\r
+       RET\r
+;\r
+; Gets a byte of HEX data from serial port.\r
+;\r
+GETBYT:        CALL    GETNIB          ; Get first nibble\r
+       RLC                     ; Shift into\r
+       RLC                     ; Upper nibble\r
+       RLC                     ; Of result\r
+       RLC                     ; To make room for lower\r
+       MOV     E,A             ; Keep high digit\r
+       CALL    GETNIB          ; Get second digit\r
+       ORA     E               ; Insert high digit\r
+       RET\r
+; GETS A NIBBLE FROM THE TERMINAL (IN ASCII HEX)\r
+GETNIB:        CALL    INCHR           ; Get a character\r
+       SUI     '0'             ; Is it < '0'?\r
+       JC      GETN1           ; Yes, invalid\r
+       CPI     10              ; 0-9?\r
+       RC                      ; Yes, its OK\r
+       SUI     7               ; Convert\r
+       CPI     10              ; 9-A?\r
+       JC      GETN1           ; Yes, invalid\r
+       CPI     16              ; A-F?\r
+       RC                      ; Yes, its OK\r
+GETN1: POP     D               ; Remove GETNIB RET addr\r
+       POP     D               ; Remove GETBYT RET addr\r
+; Error during download record\r
+DLERR: ORI     0FFh            ; Error indicator\r
+       RET\r
+;\r
+; Read an input line from the console\r
+;\r
+INPT:  LXI     H,BUFFER        ; Point to input buffer\r
+INPT1: CALL    INCHR           ; Get a char\r
+       CPI     1Bh             ; ESCAPE?\r
+       JZ      RECR            ; Back for command\r
+       CPI     0Dh             ; Carriage return?\r
+       JZ      INPT4           ; Yes, exit\r
+       MOV     D,A             ; Save for later\r
+; Test for DELETE function\r
+       CPI     7Fh             ; Is it delete?\r
+       JZ      INPT3           ; Yes, it is\r
+       CPI     08h             ; Backspace?\r
+       JZ      INPT3           ; Yes, it is\r
+; Insert character in buffer\r
+       MOV     A,L             ; Get low address\r
+       CPI     (BUFFER&255)+30 ; Beyond end?\r
+       MVI     A,7             ; Assume error\r
+       JZ      INPT2           ; Yes, report error\r
+       MOV     A,D             ; Get char back\r
+       MOV     M,A             ; Save in memory\r
+       INX     H               ; Advance\r
+INPT2: CALL    OUT             ; Echo it\r
+       JMP     INPT1           ; And proceed\r
+; Delete last character from buffer\r
+INPT3: MOV     A,L             ; Get char\r
+       CPI     BUFFER&255      ; At begining\r
+       MVI     A,7             ; Assume error\r
+       JZ      INPT2           ; Report error\r
+       PUSH    H               ; Save H\r
+       CALL    PRTMSG          ; Output message\r
+       DB      8,' ',8,0       ; Wipe away character\r
+       POP     H               ; Restore H\r
+       DCX     H               ; Backup\r
+       JMP     INPT1           ; And proceed\r
+; Terminate the command\r
+INPT4: MVI     M,0             ; Zero terminate\r
+       CALL    CRLF            ; New line\r
+       LXI     D,BUFFER        ; Point to input buffer\r
+; Advance to next non-blank in buffer\r
+SKIP:  LDAX    D               ; Get char from buffer\r
+       INX     D               ; Advance\r
+       CPI     ' '             ; Space?\r
+       JZ      SKIP            ; Yes, keep looking\r
+       DCX     D               ; Backup to it\r
+       JMP     TOCAP           ; And convert to upper\r
+;\r
+; Read next character from command & convert to upper case\r
+;\r
+GETCHI:        INX     D               ; Skip next character\r
+GETCHR:        LDAX    D               ; Get char from command line\r
+       ANA     A               ; End of line?\r
+       RZ                      ; Yes, return with it\r
+       INX     D               ; Advance command pointer\r
+;\r
+; Convert character in A to uppercase, set Z if SPACE or EOL\r
+;\r
+TOCAP: CPI     61h             ; Lower case?\r
+       JC      TOCAP1          ; Yes, its ok\r
+       ANI     5Fh             ; Convert to UPPER\r
+TOCAP1:        CPI     ' '             ; Space\r
+       RZ                      ; Yes, indicate\r
+       ANA     A               ; Set 'Z' if EOL\r
+       RET\r
+;\r
+; Get 8 bit HEX operands to command\r
+;\r
+CALC8: CALL    CALC            ; Get operand\r
+       MOV     A,H             ; High byte must be zero\r
+       ORA     A\r
+       JNZ     ERROR           ; Bad value\r
+       MOV     A,L             ; Value also to A\r
+       RET\r
+;\r
+; Get 16 bit HEX operands to command\r
+;\r
+CALC:  PUSH    B               ; Save B-C\r
+       CALL    SKIP            ; Find start of operand\r
+       LXI     H,0             ; Begin with zero value\r
+       MOV     C,H             ; Clear flag\r
+CALC1: CALL    GETCHR          ; Get next char\r
+       JZ      CALC3           ; End of number\r
+       CALL    VALHEX          ; Is it valid hex?\r
+       JC      ERROR           ; No, report error\r
+       DAD     H               ; HL = HL*2\r
+       DAD     H               ; HL = HL*4\r
+       DAD     H               ; HL = HL*8\r
+       DAD     H               ; HL = HL*16 (Shift over 4 bits)\r
+       SUI     '0'             ; Convert to ASCII\r
+       CPI     10              ; Decimal number?\r
+       JC      CALC2           ; Yes, its ok\r
+       SUI     7               ; Convert to HEX\r
+CALC2: ORA     L               ; Include in final value\r
+       MOV     L,A             ; Resave low bute\r
+       MVI     C,0FFh          ; Set flag & indicate we have char\r
+       JMP     CALC1           ; And continue\r
+; End of input string was found\r
+CALC3: MOV     A,C             ; Get flag\r
+       POP     B               ; Restore B-C\r
+       ANA     A               ; Was there any digits?\r
+       JZ      ERROR           ; No, invalid\r
+       RET\r
+; Test for character in A as valid hex\r
+VALHEX:        CPI     '0'             ; < '0'\r
+       RC                      ; Too low\r
+       CPI     'G'             ; >'F'\r
+       CMC                     ; Set C state\r
+       RC                      ; Too high\r
+       CPI     3Ah             ; <='9'\r
+       CMC                     ; Set C state\r
+       RNC                     ; Yes, its OK\r
+       CPI     'A'             ; Set C if < 'A'\r
+       RET\r
+;\r
+; Display the user process registers\r
+;\r
+REGDIS:        LHLD    BC              ; Get saved BC pair\r
+       LXI     B,'BC'          ; And register names\r
+       CALL    OUTPT           ; Output\r
+       LHLD    DE              ; Get saved DE pair\r
+       LXI     B,'DE'          ; And register names\r
+       CALL    OUTPT           ; Output\r
+       LHLD    HL              ; Get saved HL pair\r
+       LXI     B,'HL'          ; And register names\r
+       CALL    OUTPT           ; Output\r
+       LHLD    SP              ; Get saved SP\r
+       LXI     B,'SP'          ; And register name\r
+       CALL    OUTPT           ; Output\r
+       LHLD    PC              ; Get saved PC\r
+       LXI     B,'PC'          ; And regsiter name\r
+       CALL    OUTPT           ; Output\r
+       CALL    PRTMSG          ; Output message\r
+       DB      " PSW=",0\r
+       LHLD    PSW             ; Get saved PSW\r
+       CALL    HLOUT2          ; Output value (with two spaces)\r
+       CALL    PRTMSG          ; Output\r
+       DB      " FLAGS=",0\r
+       LHLD    PSW-1           ; Get Flags to H\r
+       MVI     B,'S'           ; 'S' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'Z'           ; 'Z' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'K'           ; 'K' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'A'           ; 'A' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'3'           ; 3. bit flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'P'           ; 'P' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'V'           ; 'V' flag\r
+       CALL    OUTB            ; Display\r
+       MVI     B,'C'           ; 'C' flag\r
+       CALL    OUTB            ; Display\r
+       JMP     CRLF            ; New line & exit\r
+; Display contents of a register pair\r
+OUTPT: MOV     A,B             ; Get first char of name\r
+       CALL    OUT             ; Output\r
+       MOV     A,C             ; Get second char of name\r
+       CALL    OUT             ; Output\r
+       MVI     A,'='           ; Get separator\r
+       CALL    OUT             ; Output\r
+HLOUT2:        CALL    HLOUT           ; Output value\r
+       CALL    SPACE           ; Output a space\r
+; Display a space on the console\r
+SPACE: MVI     A,' '           ; Get a spave\r
+       JMP     OUT             ; Display it\r
+; Display an individual flag bit B=title, H[7]=bit\r
+OUTB:  DAD     H               ; Shift H[7] into carry\r
+       MVI     A,'-'           ; Dash for not set flag\r
+       JNC     OUT             ; Display dash\r
+       MOV     A,B             ; Get character\r
+       JMP     OUT             ; And display\r
+;\r
+; Display an instruction in disassembly format\r
+;\r
+DINST: PUSH    D               ; Save address\r
+       MOV     A,D             ; Get high value\r
+       CALL    HPR             ; Output\r
+       MOV     A,E             ; Get low address\r
+       CALL    HPR             ; Output\r
+       CALL    SPACE           ; Output a space\r
+       CALL    LOOK            ; Lookup instruction\r
+       ANI     03h             ; Save length\r
+       PUSH    PSW             ; Save length\r
+       PUSH    H               ; Save table address\r
+       MVI     B,4             ; 4 spaces total\r
+       MOV     C,A             ; Save count\r
+       DCX     D               ; Backup address\r
+; Display the opcode bytes in HEX\r
+VLP1:  INX     D               ; Advance\r
+       LDAX    D               ; Get opcode\r
+       CALL    HPR             ; Output in HEX\r
+       CALL    SPACE           ; Separator\r
+       DCR     B               ; Reduce count\r
+       DCR     C               ; Reduce count of opcodes\r
+       JNZ     VLP1            ; Do them all\r
+; Fill in to boundary\r
+VLP2:  CALL    SPACE           ; Space over\r
+       CALL    SPACE           ; Space over\r
+       CALL    SPACE           ; Spave over\r
+       DCR     B               ; Reduce count\r
+       JNZ     VLP2            ; Do them all\r
+; DISPLAY ASCII equivalent of opcodes\r
+       POP     B               ; Restore table address\r
+       POP     PSW             ; Restore type/length\r
+       POP     D               ; Restore instruction address\r
+       PUSH    D               ; Resave\r
+       PUSH    PSW             ; Resave\r
+       MVI     H,8             ; 8 spaces/field\r
+       ANI     0Fh             ; Save only length\r
+       MOV     L,A             ; Save for later\r
+PCHR:  LDAX    D               ; Get byte from opcode\r
+       INX     D               ; Advance\r
+       CALL    OUTP            ; Display (if printable)\r
+       DCR     H               ; Reduce field count\r
+       DCR     L               ; Reduce opcode count\r
+       JNZ     PCHR            ; Do them all\r
+; Space over to instruction address\r
+SPLP:  CALL    SPACE           ; Output a space\r
+       DCR     H               ; Reduce count\r
+       JNZ     SPLP            ; Do them all\r
+       MVI     D,6             ; Field width\r
+VLP3:  LDAX    B               ; Get char from table\r
+       ANA     A               ; End of string?\r
+       JZ      VOUT1           ; Yes, exit\r
+       CALL    OUT             ; Output it\r
+       INX     B               ; Advance to next\r
+       DCR     D               ; reduce count\r
+       CPI     ' '             ; end of name?\r
+       JNZ     VLP3            ; no, keep going\r
+; Fill in name field with spaces\r
+VOUT:  DCR     D               ; reduce count\r
+       JZ      VLP3            ; Keep going\r
+       CALL    SPACE           ; Output a space\r
+       JMP     VOUT            ; And proceed\r
+; Output operands for the instruction\r
+VOUT1: POP     PSW             ; Restore type\r
+       POP     D               ; Restore instruction address\r
+       DCR     A               ; Is it type1?\r
+       JZ      T1              ; Yes, handle it\r
+; Type 2 -  One byte immediate date\r
+T2:    PUSH    PSW             ; Save type\r
+       MVI     A,'$'           ; Get HEX indicator\r
+       CALL    OUT             ; Output\r
+       POP     PSW             ; Restore type\r
+       DCR     A               ; Type 2?\r
+       JNZ     T3              ; No, try next\r
+       INX     D               ; Advance to data\r
+       LDAX    D               ; Get data\r
+       CALL    HPR             ; Output in HEX\r
+; Type 1 - No operand\r
+T1:    INX     D\r
+       RET\r
+; Type 3 - Two bytes immediate data\r
+T3:    INX     D               ; Skip to low   \r
+       INX     D               ; Skip to high\r
+       LDAX    D               ; Get HIGH\r
+       CALL    HPR             ; Output\r
+       DCX     D               ; Backup to low\r
+       LDAX    D               ; Get LOW\r
+       CALL    HPR             ; Output\r
+       INX     D               ; Advance to high\r
+       INX     D\r
+       RET\r
+;\r
+; Look up instruction in table & return TYPE/LENGTH[A], and string[HL]\r
+;\r
+LOOK:  PUSH    D               ; Save DE\r
+       LDAX    D               ; Get opcode\r
+       MOV     B,A             ; Save for later\r
+       LXI     H,ITABLE        ; Point to table\r
+LOOK1: MOV     A,B             ; Get Opcode\r
+       ANA     M               ; Mask\r
+       INX     H               ; Skip mask\r
+       CMP     M               ; Does it match\r
+       INX     H               ; Skip opcode\r
+       JZ      LOOK3           ; Yes, we found it\r
+; This wasn't it, advance to the next\r
+LOOK2: MOV     A,M             ; Get byte\r
+       INX     H               ; Advance to next\r
+       ANA     A               ; End of string?\r
+       JNZ     LOOK2           ; No, keep looking\r
+       JMP     LOOK1           ; And continue\r
+; We found the instruction, copy over the text description\r
+LOOK3: MOV     C,M             ; Save type\r
+       INX     H               ; Skip type\r
+       LXI     D,BUFFER        ; Point to text buffer\r
+LOOK4: MOV     A,M             ; Get char from source\r
+       INX     H               ; Advance to next\r
+; Insert a RESTART vector number\r
+       CPI     'v'             ; Restart vector\r
+       JNZ     LOOK5           ; No, its OK\r
+       MOV     A,B             ; Get opcode\r
+       RRC                     ; Shift it\r
+       RRC                     ; Over\r
+       RRC                     ; To low digit\r
+       ANI     07h             ; Remove trash\r
+       ADI     '0'             ; Convert to digit\r
+       JMP     LOOK10          ; And set the character\r
+; Insert a register pair name\r
+LOOK5: CPI     'p'             ; Register PAIR?\r
+       JNZ     LOOK6           ; No, try next\r
+       MOV     A,B             ; Get opcode\r
+       RRC                     ; Shift\r
+       RRC                     ; Over into\r
+       RRC                     ; Low digit\r
+       RRC                     ; For lookup\r
+       ANI     03h             ; Save only RP\r
+       PUSH    H               ; Save HL\r
+       LXI     H,RPTAB         ; Point to pair table\r
+       JMP     LOOK9           ; And proceed\r
+; Insert destination register name\r
+LOOK6: CPI     'd'             ; Set destination?\r
+       JNZ     LOOK7           ; No, try next\r
+       MOV     A,B             ; Get opcode\r
+       RRC                     ; Shift\r
+       RRC                     ; Into low\r
+       RRC                     ; digit\r
+       JMP     LOOK8           ; And proceed\r
+; Insert source register name\r
+LOOK7: CPI     's'             ; Source register?\r
+       JNZ     LOOK10          ; No, its OK\r
+       MOV     A,B             ; Get opcode\r
+; Lookup a general processor register\r
+LOOK8: ANI     07h             ; Save only source\r
+       PUSH    H               ; Save HL\r
+       LXI     H,RTAB          ; Point to table\r
+; Lookup register in table\r
+LOOK9: ADD     L               ; Offset to value\r
+       MOV     L,A             ; Resave address\r
+       MOV     A,M             ; Get character\r
+       CPI     'S'             ; 'SP' register ?\r
+       JNZ     LOOK9A          ; No, skip\r
+       STAX    D               ; Save 'S'\r
+       INX     D               ; Advance to next\r
+       MVI     A,'P'           ; Character 'P'\r
+LOOK9A:        POP     H               ; Restore HL\r
+; Save character in destination string\r
+LOOK10:        STAX    D               ; Save value\r
+       INX     D               ; Advance to next\r
+       ANA     A               ; End of list?\r
+       JNZ     LOOK4           ; No, keep copying\r
+; End of LIST\r
+       LXI     H,BUFFER        ; Point to description\r
+       MOV     A,C             ; Get length\r
+       POP     D               ; Restore DE\r
+       RET\r
+;\r
+; Opcode disassembly table: MASK, OPCODE, TYPE/LENGTH, STRINGZ\r
+;\r
+ITABLE:        DB      0FFh,0FEh,02h\r
+       DB      "CPI ",0\r
+       DB      0FFh,3Ah,03h\r
+       DB      "LDA ",0\r
+       DB      0FFh,32h,03h\r
+       DB      "STA ",0\r
+       DB      0FFh,2Ah,03h\r
+       DB      "LHLD ",0\r
+       DB      0FFh,22h,03h\r
+       DB      "SHLD ",0\r
+       DB      0FFh,0F5h,01h\r
+       DB      "PUSH PSW",0\r
+       DB      0FFh,0F1h,01h\r
+       DB      "POP PSW",0\r
+       DB      0FFh,27h,01h\r
+       DB      "DAA",0\r
+       DB      0FFh,76h,01h\r
+       DB      "HLT",0\r
+       DB      0FFh,0FBh,01h\r
+       DB      "EI",0\r
+       DB      0FFh,0F3h,01h\r
+       DB      "DI",0\r
+       DB      0FFh,37h,01h\r
+       DB      "STC",0\r
+       DB      0FFh,3Fh,01h\r
+       DB      "CMC",0\r
+       DB      0FFh,2Fh,01h\r
+       DB      "CMA",0\r
+       DB      0FFh,0EBh,01h\r
+       DB      "XCHG",0\r
+       DB      0FFh,0E3h,01h\r
+       DB      "XTHL",0\r
+       DB      0FFh,0F9h,01h\r
+       DB      "SPHL",0\r
+       DB      0FFh,0E9h,01h\r
+       DB      "PCHL",0\r
+       DB      0FFh,0DBh,02h\r
+       DB      "IN ",0\r
+       DB      0FFh,0D3h,02h\r
+       DB      "OUT ",0\r
+       DB      0FFh,07h,01h\r
+       DB      "RLC",0\r
+       DB      0FFh,0Fh,01h\r
+       DB      "RRC",0\r
+       DB      0FFh,17h,01h\r
+       DB      "RAL",0\r
+       DB      0FFh,1Fh,01h\r
+       DB      "RAR",0\r
+       DB      0FFh,0C6h,02h\r
+       DB      "ADI ",0\r
+       DB      0FFh,0CEh,02h\r
+       DB      "ACI ",0\r
+       DB      0FFh,0D6h,02h\r
+       DB      "SUI ",0\r
+       DB      0FFh,0DEh,02h\r
+       DB      "SBI ",0\r
+       DB      0FFh,0E6h,02h\r
+       DB      "ANI ",0\r
+       DB      0FFh,0F6h,02h\r
+       DB      "ORI ",0\r
+       DB      0FFh,0EEh,02h\r
+       DB      "XRI ",0\r
+       DB      0FFh,00h,01h\r
+       DB      "NOP",0\r
+; 8085 specific instructions\r
+       DB      0FFh,20h,01h\r
+       DB      "RIM",0\r
+       DB      0FFh,30h,01h\r
+       DB      "SIM",0\r
+; 8085 undocumented instructions\r
+       DB      0FFh,08h,01h\r
+       DB      "DSUB B",0\r
+       DB      0FFh,10h,01h\r
+       DB      "ARHL",0\r
+       DB      0FFh,18h,01h\r
+       DB      "RDEL",0\r
+       DB      0FFh,28h,02h\r
+       DB      "LDHI ",0\r
+       DB      0FFh,38h,02h\r
+       DB      "LDSI ",0\r
+       DB      0FFh,0CBh,01h\r
+       DB      "RSTV",0\r
+       DB      0FFh,0D9h,01h\r
+       DB      "SHLX D",0\r
+       DB      0FFh,0DDh,03h\r
+       DB      "JNK ",0\r
+       DB      0FFh,0EDh,01h\r
+       DB      "LHLX D",0\r
+       DB      0FFh,0FDh,03h\r
+       DB      "JK ",0\r
+; Jumps, Calls & Returns\r
+       DB      0FFh,0C3h,0Bh\r
+       DB      "JMP ",0\r
+       DB      0FFh,0CAh,43h\r
+       DB      "JZ ",0\r
+       DB      0FFh,0C2h,4Bh\r
+       DB      "JNZ ",0\r
+       DB      0FFh,0DAh,13h\r
+       DB      "JC ",0\r
+       DB      0FFh,0D2h,1Bh\r
+       DB      "JNC ",0\r
+       DB      0FFh,0EAh,23h\r
+       DB      "JPE ",0\r
+       DB      0FFh,0E2h,2Bh\r
+       DB      "JPO ",0\r
+       DB      0FFh,0FAh,83h\r
+       DB      "JM ",0\r
+       DB      0FFh,0F2h,8Bh\r
+       DB      "JP ",0\r
+       DB      0FFh,0CDh,0Bh\r
+       DB      "CALL ",0\r
+       DB      0FFh,0CCh,43h\r
+       DB      "CZ ",0\r
+       DB      0FFh,0C4h,4Bh\r
+       DB      "CNZ ",0\r
+       DB      0FFh,0DCh,13h\r
+       DB      "CC ",0\r
+       DB      0FFh,0D4h,1Bh\r
+       DB      "CNC ",0\r
+       DB      0FFh,0ECh,23h\r
+       DB      "CPE ",0\r
+       DB      0FFh,0E4h,2Bh\r
+       DB      "CPO ",0\r
+       DB      0FFh,0FCh,83h\r
+       DB      "CM ",0\r
+       DB      0FFh,0F4h,8Bh\r
+       DB      "CP ",0\r
+       DB      0FFh,0C9h,05h\r
+       DB      "RET",0\r
+       DB      0FFh,0C8h,45h\r
+       DB      "RZ",0\r
+       DB      0FFh,0C0h,4Dh\r
+       DB      "RNZ",0\r
+       DB      0FFh,0D8h,15h\r
+       DB      "RC",0\r
+       DB      0FFh,0D0h,1Dh\r
+       DB      "RNC",0\r
+       DB      0FFh,0E8h,25h\r
+       DB      "RPE",0\r
+       DB      0FFh,0E0h,2Dh\r
+       DB      "RPO",0\r
+       DB      0FFh,0F8h,85h\r
+       DB      "RM",0\r
+       DB      0FFh,0F0h,8Dh\r
+       DB      "RP",0\r
+; Register based instructions\r
+       DB      0C0h,40h,01h\r
+       DB      "MOV d,s",0\r
+       DB      0C7h,06h,02h\r
+       DB      "MVI d,",0\r
+       DB      0F8h,90h,01h\r
+       DB      "SUB s",0\r
+       DB      0F8h,98h,01h\r
+       DB      "SBB s",0\r
+       DB      0F8h,80h,01h\r
+       DB      "ADD s",0\r
+       DB      0F8h,88h,01h\r
+       DB      "ADC s",0\r
+       DB      0F8h,0A0h,01h\r
+       DB      "ANA s",0\r
+       DB      0F8h,0B0h,01h\r
+       DB      "ORA s",0\r
+       DB      0F8h,0A8h,01h\r
+       DB      "XRA s",0\r
+       DB      0F8h,0B8h,01h\r
+       DB      "CMP s",0\r
+       DB      0C7h,04h,01h\r
+       DB      "INR d",0\r
+       DB      0C7h,05h,01h\r
+       DB      "DCR d",0\r
+; Register pair instructions\r
+       DB      0CFh,01h,03h\r
+       DB      "LXI p,",0\r
+       DB      0EFh,0Ah,01h\r
+       DB      "LDAX p",0\r
+       DB      0EFh,02h,01h\r
+       DB      "STAX p",0\r
+       DB      0CFh,03h,01h\r
+       DB      "INX p",0\r
+       DB      0CFh,0Bh,01h\r
+       DB      "DCX p",0\r
+       DB      0CFh,09h,01h\r
+       DB      "DAD p",0\r
+       DB      0CFh,0C5h,01h\r
+       DB      "PUSH p",0\r
+       DB      0CFh,0C1h,01h\r
+       DB      "POP p",0\r
+; Restart instruction\r
+       DB      0C7h,0C7h,01h\r
+       DB      "RST v",0\r
+; This entry always matches invalid opcodes\r
+       DB      00h,00h,01h\r
+       DB      "DB ",0\r
+; Misc Strings and messages\r
+ON:    DB      "ON ",0\r
+OFF:   DB      "OFF",0\r
+AUTMSG:        DB      "AUTOREG=",0\r
+SUBMSG:        DB      " SUBTRACE=",0\r
+TRCMSG:        DB      " TRACE=",0\r
+HTEXT: DB      "MON85 Commands:"\r
+       DB      0Dh,0Ah,0\r
+       DB      "A ON|OFF!Enable/Disable Automatic register display",0\r
+       DB      "B [bp address]!Set/Display breakpoints",0\r
+       DB      "C <src> <dest> <size>!Copy memory",0\r
+       DB      "D <address>!Display memory in assembly format",0\r
+       DB      "E <address>!Edit memory",0\r
+       DB      "F <start> <end> <value>!Fill memory",0\r
+       DB      "G [address]!Begin/Resume execution",0\r
+       DB      "H <start> <end>!Send out memory in Intel HEX format",0\r
+       DB      "I <port>!Input from port",0\r
+       DB      "L [address]!Load image into memory",0\r
+       DB      "M <address>!Display memory in hex dump format",0\r
+       DB      "O <port> <data>!Output to port",0\r
+       DB      "R [rp value]!Set/Display program registers",0\r
+       DB      "S ON|OFF!Enable/Disable Subroutine trace",0\r
+       DB      "T ON|OFF!Enable/Disable Trace mode",0\r
+       DB      "U [address]!Set/Display program base address",0\r
+       DB      0\r
+;\r
+; Read a character, and wait for it\r
+;\r
+INCHR: CALL    IN              ; Check for a character\r
+       ANA     A               ; Is there any data?\r
+       JZ      INCHR           ; Wait for it\r
+       RET\r
+;\r
+; Display HL in hexidecimal\r
+;\r
+HLOUT: MOV     A,H             ; Get HIGH byte\r
+       CALL    HPR             ; Output\r
+       MOV     A,L             ; Get LOW byte\r
+;\r
+; Display A in hexidecimal\r
+;\r
+HPR:   PUSH    PSW             ; Save low digit\r
+       RRC                     ; Shift\r
+       RRC                     ; high\r
+       RRC                     ; digit\r
+       RRC                     ; into low\r
+       CALL    HOUT            ; Display a single digit\r
+       POP     PSW             ; Restore low digit\r
+HOUT:  ANI     0Fh             ; Remove high digit\r
+       CPI     10              ; Convert to ASCII\r
+       SBI     2Fh\r
+       DAA\r
+       JMP     OUT             ; And output it\r
+;\r
+; Display message [PC]\r
+;\r
+PRTMSG:        POP     H               ; Get address\r
+       CALL    PRTSTR          ; Output message\r
+       PCHL                    ; And return\r
+;\r
+; Display message [HL]\r
+;\r
+PRTSTR:        MOV     A,M             ; Get byte from message\r
+       INX     H               ; Advance to next\r
+       ANA     A               ; End of message?\r
+       RZ                      ; Yes, exit\r
+       CALL    OUT             ; Output the character\r
+       JMP     PRTSTR          ; And proceed\r
+;\r
+; Handle output suspension\r
+;\r
+CHKSUS:        CALL    CRLF            ; New line\r
+       LDA     OFLAG           ; Is output suspended?\r
+       ANA     A               ; Test flag\r
+       JNZ     CHKS1           ; Yes it is\r
+       CALL    IN              ; Test for CONTROL-C interrupt\r
+       CPI     1Bh             ; ESCAPE?\r
+       JZ      REST            ; Abort\r
+       CPI     ' '             ; SPACE - Suspend command\r
+       RNZ\r
+       STA     OFLAG           ; Set the flag\r
+; Output is suspended, wait for command\r
+CHKS1: CALL    INCHR           ; Get char\r
+       CPI     ' '             ; One line?\r
+       RZ                      ; Allow it\r
+       CPI     1Bh             ; ESCAPE?\r
+       JZ      REST            ; Abort\r
+       CPI     0Dh             ; Resume?\r
+       JNZ     CHKS1           ; Keep going\r
+       SUB     A               ; Reset flag\r
+       STA     OFLAG           ; Write it\r
+       RET\r
+; Display a character if its printable\r
+OUTP:  CPI     ' '             ; < ' '\r
+       JC      OUTP1           ; Invalid, exchange it\r
+       CPI     7Fh             ; Printable?\r
+       JC      OUT             ; Ok to display\r
+OUTP1: MVI     A,'.'           ; Set to DOT to indicate invalid\r
+       JMP     OUT             ; And display\r
+;\r
+; Write a Line-Feed and Carriage-Return to console\r
+;\r
+CRLF:  MVI     A,0Dh           ; Carriage return\r
+       CALL    OUT             ; Output\r
+       MVI     A,0Ah           ; Line-feed\r
+;\r
+; User supplied I/O routines.\r
+;-----------------------------------------------------------\r
+; NOTE: "OUT" must appear first because "CRLF" falls into it.\r
+;\r
+; Write character in A to console (8251 uart)\r
+OUT:   PUSH    PSW             ; Save char\r
+OUT1:  IN      9               ; Get 8251 status\r
+       RRC                     ; Test TX bit\r
+       JNC     OUT1            ; Not ready\r
+       POP     PSW             ; Restore char\r
+       OUT     8               ; Write 8251 data\r
+       RET\r
+; Check for a character from the console (8251 uart)\r
+IN:    IN      9               ; Get 8251 status\r
+       ANI     00000010b       ; Test for ready\r
+       RZ                      ; No char\r
+       IN      8               ; Get 8251 data\r
+       RET\r
+;\r
+; Initialize the timer & uart\r
+;\r
+; 8251A initialisation, according to datasheet (3x 00h + RESET 040h)  \r
+INIT:  XRA     A               ; Insure not setup mode\r
+       OUT     9               ; Write once\r
+       OUT     9               ; Write again (now in operate mode)\r
+       OUT     9               ; Write again (now in operate mode)\r
+       MVI     A,01000000b     ; Reset\r
+       OUT     9               ; write it\r
+       MVI     A,01001110b     ; 8 data, 1 stop, x16\r
+       OUT     9               ; Write it\r
+       MVI     A,00010101b     ; RTS,DTR,Enable RX,TX\r
+       OUT     9               ; Write it\r
+; starts timer in 8155 RIOT chip\r
+; timer count rate 307200Hz, with divider 15360(3C00H)\r
+; is the resulting interrupt rate exactly 20Hz\r
+I8155: XRA     A               ; counter low 8 bits\r
+       OUT     04h\r
+       MVI     A,7Ch           ; counter high 6 bits + mode cont.square -> 0 1\r
+       OUT     05h\r
+       MVI     A,0C0h          ; 8155 mode, start timer,\r
+       OUT     00h             ; disable port C interrupts, all ports input\r
+       RET\r
diff --git a/software/mon85/mon85-v12-ncb85.bin b/software/mon85/mon85-v12-ncb85.bin
new file mode 100644 (file)
index 0000000..bfff328
Binary files /dev/null and b/software/mon85/mon85-v12-ncb85.bin differ
diff --git a/software/mon85/mon85-v12-ncb85.hex b/software/mon85/mon85-v12-ncb85.hex
new file mode 100644 (file)
index 0000000..80119e9
--- /dev/null
@@ -0,0 +1,256 @@
+:06000000310000C30B01FA\r
+:03000800C35A00D8\r
+:10000C00CD44000CCD440010CD440014CD44001858\r
+:10001C00CD44001CCD440020CD440024CD44002808\r
+:10002C00CD44002CCD440030CD440034CD440038B8\r
+:10003C00CD44003CCD440040E3F57E2AA0FF6FF197\r
+:10004C00E3C942434445484C4D414244485322A2E3\r
+:10005C00FFEB22A4FFE122ACFFC5E122A6FFF5E1F4\r
+:10006C0022A8FF2100003922AAFF3100002AACFF90\r
+:10007C002B22ACFF11B2FF06301A13BC1A13C2911B\r
+:10008C0000BDCA9C00130478FE38DA8500C3B500A5\r
+:10009C00CD580F2A2A20427265616B706F696E749D\r
+:1000AC00200078CDAA0FCDA30F21B2FF060856234E\r
+:1000BC005E237AB3CAC5007E122305C2BA003AAFDA\r
+:1000CC00FFA7C2DB003AB1FFA7C41308C38D01CD53\r
+:1000DC00580F543E20002AACFFEBCDAA08CDA30F3D\r
+:1000EC003AB1FFA7C41308CD380FFE20CA0A03FE8D\r
+:1000FC001BCA8A01FE3FC2F300CD1308C3DB00CD3F\r
+:10010C00BD0FCD580F0D0A4D4F4E38352056657228\r
+:10011C0073696F6E20312E320D0A0A436F7079723B\r
+:10012C006967687420313937392D323030372044C3\r
+:10013C006176652044756E6669656C640D0A3230B3\r
+:10014C00313220526F6D616E20426F72696B0D0AF5\r
+:10015C00416C6C2072696768747320726573657288\r
+:10016C007665642E0A0021A0FF0E603600230DC2B6\r
+:10017C00770121FFFF22B0FF21A0FF22AAFFCDA310\r
+:10018C000F310000CD580F433E2000CD67074721AB\r
+:10019C00BB017E23B8CAB2012323A7C29E013E3FF6\r
+:1001AC00CDAA0FC38A01137E23666FCDB007E94138\r
+:1001BC00BD04425E0243420544BD0545D804461CBD\r
+:1001CC000547FA0248ED054929024C61064D7B05AD\r
+:1001DC004F480252400453C60454CF0455CF053F38\r
+:1001EC00F101008D0121BB0C9732AEFF0E197E235D\r
+:1001FC00A7CA1E02FE21CA0C02CDAA0F0DC3FA011A\r
+:10020C00CD9B080DC20C023E2DCDAA0FCD9B08C371\r
+:10021C00FA01CD670F7EA7C2F801C38A01CDCC07C6\r
+:10022C003EDB26C932CAFF22CBFFCD580F444154C6\r
+:10023C00413D00CDCAFFCD450FC38A01CDCC073E51\r
+:10024C00D326C932CAFF22CBFFCDCC07CDCAFFC300\r
+:10025C008D01CA8302CDCC07FE08D2AA0121AFFFC3\r
+:10026C00010300093DF26F02E5CDD607D1EB7223F5\r
+:10027C0073231A77C38D0111B2FF06303E42CDAA0B\r
+:10028C000F78CDAA0F3E3DCDAA0F1A67131A6FB483\r
+:10029C00CAA502CD400FC3AD02CD580F2A2A2A2A77\r
+:1002AC00003E20CDAA0FCDAA0F78FE33CCA30F139E\r
+:1002BC00130478FE38DA8802CDA30F219F0C3AB1D3\r
+:1002CC00FFCDE80221A80C3AB0FFCDE80221B30C17\r
+:1002DC003AAFFFCDE802CDA30FC38D01F5CD5D0F75\r
+:1002EC00F1219B0CA7CA5D0F21970CC35D0FCA03AC\r
+:1002FC0003CDD60722ACFF3AAFFFA7C2DB0097674E\r
+:10030C006F32CAFF22CBFF2AACFFEBCD370947E691\r
+:10031C00034F21CAFF1A7723130DC22103EB3EC3EF\r
+:10032C0032CDFF22CEFF3AAFFFA7CA0A04C52ACEB0\r
+:10033C00FF2322D0FF21380422CEFFC13ACAFFFE90\r
+:10034C00E9C256032AA2FFC3FD03FECBC269033ADE\r
+:10035C00A8FFE602C20A0432CAFFC30A04FEDDCAC1\r
+:10036C007303FEFDC28203E6204F3AA8FFE620A9E4\r
+:10037C00CAEC03C30A0478FE0BCAC703FE05CAF213\r
+:10038C0003E6F8CA0A04E6083AA8FFCA9B032F4FF3\r
+:10039C007817DAAF0317DAB50317DABB0379E6017E\r
+:1003AC00C3BE0379E680C3BE0379E640C3BE0379BE\r
+:1003BC00E604CA0A0478E604C2F2033ACAFFFECD88\r
+:1003CC00CAD603E6C7FEC4C2EC033AB0FFA7CA0AFA\r
+:1003DC00042AD0FF2BEB2AAAFF2B722B7322AAFF25\r
+:1003EC002ACBFFC3FD032AAAFF5E23562322AAFFB2\r
+:1003FC00EB2322D0FF97676F32CAFF22CBFF11B2DB\r
+:10040C00FF0E081A67131A6F13B4CA1B0436CF13E6\r
+:10041C000DC20F042AAAFFF92AA6FFE5C12AA8FFDC\r
+:10042C00E5F12AA4FFEB2AA2FFC3CAFFE52AD0FFFD\r
+:10043C00E3C35A00C24904CD1308C38D0147CDBB99\r
+:10044C00074FCA5704CDBC07C25104CDD60778FE5E\r
+:10045C0048C2660422A2FFC38D01FE44C27104226D\r
+:10046C00A4FFC38D01FE42C27C0422A6FFC38D01F2\r
+:10047C00FE53C2870422AAFFC38D01FE50C2AA01FB\r
+:10048C0079FE53C2980422A8FFC38D01FE43C2AA71\r
+:10049C000122ACFFC38D01CDB007FE4FC2AA01CD26\r
+:1004AC00BB070600FE46CABB04FE4EC2AA01057875\r
+:1004BC00C9CDA30432B1FFC38D01CDA30432B0FF6B\r
+:1004CC00C38D01CDA30432AFFFC38D01CDD607CDB3\r
+:1004DC00400FCD9B087ECD450F3E3DCDAA0FE5CDFF\r
+:1004EC006707E123CADB042B2BFE2DCADB0423FE9A\r
+:1004FC0027C20C05131A13A7CADB047723C3010503\r
+:10050C00E5CDCC07E17723CDB007C20C05C3DB04E6\r
+:10051C00CDD607E5CDD607E5CDCC074FD113E1CD30\r
+:10052C003C05D2AA017123CD3C05DA3105C38D01FE\r
+:10053C007CBAC07DBBC9CDD607E5CDD607E5CDD6F7\r
+:10054C0007444DD1E178B1CA8D01CD3C05DA69057E\r
+:10055C007E1223130B79B0C25C05C38D01092BEB02\r
+:10056C00092B1A771B2B0B79B0C26E05C38D01CDED\r
+:10057C00D6079732AEFFCD95081610E57ECD450F08\r
+:10058C00CD9B087AFE09CC9B087AE607FE05CC9B2E\r
+:10059C00082315C288051604CD9B0815C2A405E1D5\r
+:1005AC0016107ECD940F2315C2AE05CD670FC382F6\r
+:1005BC0005CDD607E5D19732AEFFCDAA08CD670F92\r
+:1005CC00C3C605C2E405CD580F424153453D002A30\r
+:1005DC00A0FFCD400FC38A01CDD60722A0FFC38D4B\r
+:1005EC0001CDD607E5CDD60723D1CD3C05DAAA013E\r
+:1005FC007D936F7C9A67EB7AB3CA1B0606107AB7A9\r
+:10060C00C215067BB8D2150643CD2F06C30306CD03\r
+:10061C00580F3A303030303030303146460D0A0009\r
+:10062C00C38D013E3ACDAA0F784FCD450F7C814F3B\r
+:10063C007CCD450F7D814F7DCD450FAFCD450F7ED8\r
+:10064C00814F7E23CD450F1B05C24B06792F3CCD28\r
+:10065C00450FC3A30F3E0FCA6E06CDD60722D3FF9C\r
+:10066C003EFF21000032D0FF22D1FFCDA406C28371\r
+:10067C0006D27706C39406CD580F3F4C6F616420A9\r
+:10068C006572726F720D0A000E00CDB50FA7C29481\r
+:10069C00060DC29606C38D01CD380FFE3ACAEB0685\r
+:1006AC00FE53C2A406CD380FFE30CAA406FE39CACA\r
+:1006BC001907FE31C26407CD40074FD60347CD4022\r
+:1006CC000767814FCD40076F814FCD1B07CD40078A\r
+:1006DC007723814F05C2D906CD4007813CA7C9CDF0\r
+:1006EC004007A7CA19074F47CD400767814FCD4038\r
+:1006FC00076F814FCD1B07CD4007814FCD4007774A\r
+:10070C0023814F05C20807CD400781A7C937C93AD5\r
+:10071C00D0FFA7C22807EB2AD1FF19C93E0032D05F\r
+:10072C00FF22A0FFF0EB2AD3FF7D936F7C9A672208\r
+:10073C00D1FF19C9CD4D07070707075FCD4D07B38B\r
+:10074C00C9CD380FD630DA6207FE0AD8D607FE0AB2\r
+:10075C00DA6207FE10D8D1D1F6FFC921D0FFCD380F\r
+:10076C000FFE1BCA8A01FE0DCAA80757FE7FCA934B\r
+:10077C0007FE08CA93077DFEEE3E07CA8D077A77FF\r
+:10078C0023CDAA0FC36A077DFED03E07CA8D07E5AD\r
+:10079C00CD580F08200800E12BC36A073600CDA303\r
+:1007AC000F11D0FF1A13FE20CAB0071BC3C00713CA\r
+:1007BC001AA7C813FE61DAC707E65FFE20C8A7C9EF\r
+:1007CC00CDD6077CB7C2AA017DC9C5CDB007210023\r
+:1007DC00004CCDBC07CAFE07CD0508DAAA012929B1\r
+:1007EC002929D630FE0ADAF707D607B56F0EFFC3F4\r
+:1007FC00DE0779C1A7CAAA01C9FE30D8FE473FD887\r
+:10080C00FE3A3FD0FE41C92AA6FF014342CD8808DB\r
+:10081C002AA4FF014544CD88082AA2FF014C48CDEB\r
+:10082C0088082AAAFF015053CD88082AACFF01433F\r
+:10083C0050CD8808CD580F205053573D002AA8FFA3\r
+:10084C00CD9508CD580F20464C4147533D002AA763\r
+:10085C00FF0653CDA008065ACDA008064BCDA00824\r
+:10086C000641CDA0080633CDA0080650CDA0080641\r
+:10087C0056CDA0080643CDA008C3A30F78CDAA0F70\r
+:10088C0079CDAA0F3E3DCDAA0FCD400FCD9B083E92\r
+:10089C0020C3AA0F293E2DD2AA0F78C3AA0FD57A4E\r
+:1008AC00CD450F7BCD450FCD9B08CD3709E603F524\r
+:1008BC00E506044F1B131ACD450FCD9B08050DC241\r
+:1008CC00C108CD9B08CD9B08CD9B0805C2CE08C1A5\r
+:1008DC00F1D1D5F52608E60F6F1A13CD940F252DFF\r
+:1008EC00C2E508CD9B0825C2EF0816060AA7CA1157\r
+:1008FC0009CDAA0F0315FE20C2F80815CAF808CDB9\r
+:10090C009B08C30709F1D13DCA2709F53E24CDAA9E\r
+:10091C000FF13DC22909131ACD450F13C913131A30\r
+:10092C00CD450F1B1ACD450F1313C9D51A4721A955\r
+:10093C000978A623BE23CA4E097E23A7C24509C344\r
+:10094C003D094E2311D0FF7E23FE76C26509780F38\r
+:10095C000F0FE607C630C39D09FE70C27809780FE9\r
+:10096C000F0F0FE603E5215600C39009FE64C28405\r
+:10097C0009780F0F0FC38A09FE73C29D0978E60729\r
+:10098C00E5214E00856F7EFE53C29C0912133E502A\r
+:10099C00E11213A7C2530921D0FF79D1C9FFFE027E\r
+:1009AC004350492000FF3A034C44412000FF3203DE\r
+:1009BC005354412000FF2A034C484C442000FF2292\r
+:1009CC000353484C442000FFF50150555348205028\r
+:1009DC00535700FFF101504F502050535700FF2741\r
+:1009EC000144414100FF7601484C5400FFFB014596\r
+:1009FC004900FFF301444900FF370153544300FF02\r
+:100A0C003F01434D4300FF2F01434D4100FFEB01DC\r
+:100A1C005843484700FFE3015854484C00FFF90184\r
+:100A2C005350484C00FFE9015043484C00FFDB0297\r
+:100A3C00494E2000FFD3024F55542000FF070152AE\r
+:100A4C004C4300FF0F0152524300FF170152414C1F\r
+:100A5C0000FF1F0152415200FFC6024144492000D1\r
+:100A6C00FFCE024143492000FFD6025355492000D6\r
+:100A7C00FFDE025342492000FFE602414E492000AE\r
+:100A8C00FFF6024F52492000FFEE02585249200057\r
+:100A9C00FF00014E4F5000FF200152494D00FF3026\r
+:100AAC000153494D00FF080144535542204200FFB9\r
+:100ABC0010014152484C00FF18015244454C00FFB4\r
+:100ACC0028024C4448492000FF38024C445349202A\r
+:100ADC0000FFCB015253545600FFD90153484C58D8\r
+:100AEC00204400FFDD034A4E4B2000FFED014C4833\r
+:100AFC004C58204400FFFD034A4B2000FFC30B4A17\r
+:100B0C004D502000FFCA434A5A2000FFC24B4A4EA8\r
+:100B1C005A2000FFDA134A432000FFD21B4A4E43EF\r
+:100B2C002000FFEA234A50452000FFE22B4A504F99\r
+:100B3C002000FFFA834A4D2000FFF28B4A50200020\r
+:100B4C00FFCD0B43414C4C2000FFCC43435A2000BB\r
+:100B5C00FFC44B434E5A2000FFDC1343432000FFDD\r
+:100B6C00D41B434E432000FFEC234350452000FF91\r
+:100B7C00E42B43504F2000FFFC83434D2000FFF437\r
+:100B8C008B43502000FFC90552455400FFC8455205\r
+:100B9C005A00FFC04D524E5A00FFD815524300FF69\r
+:100BAC00D01D524E4300FFE82552504500FFE02D6A\r
+:100BBC0052504F00FFF885524D00FFF08D525000FF\r
+:100BCC00C040014D4F5620642C7300C706024D5691\r
+:100BDC004920642C00F89001535542207300F8987A\r
+:100BEC0001534242207300F88001414444207300B9\r
+:100BFC00F88801414443207300F8A001414E412084\r
+:100C0C007300F8B0014F5241207300F8A8015852FC\r
+:100C1C0041207300F8B801434D50207300C7040104\r
+:100C2C00494E52206400C70501444352206400CF52\r
+:100C3C0001034C584920702C00EF0A014C444158D8\r
+:100C4C00207000EF020153544158207000CF030173\r
+:100C5C00494E58207000CF0B01444358207000CFF0\r
+:100C6C000901444144207000CFC501505553482020\r
+:100C7C007000CFC101504F50207000C7C7015253B4\r
+:100C8C0054207600000001444220004F4E20004FBB\r
+:100C9C004646004155544F5245473D00205355425E\r
+:100CAC0054524143453D002054524143453D004D73\r
+:100CBC004F4E383520436F6D6D616E64733A0D0A7B\r
+:100CCC000041204F4E7C4F464621456E61626C655B\r
+:100CDC002F44697361626C65204175746F6D61742A\r
+:100CEC0069632072656769737465722064697370D7\r
+:100CFC006C61790042205B62702061646472657380\r
+:100D0C00735D215365742F446973706C6179206233\r
+:100D1C007265616B706F696E74730043203C737203\r
+:100D2C00633E203C646573743E203C73697A653E77\r
+:100D3C0021436F7079206D656D6F72790044203C92\r
+:100D4C00616464726573733E21446973706C61797C\r
+:100D5C00206D656D6F727920696E20617373656D9E\r
+:100D6C00626C7920666F726D61740045203C616421\r
+:100D7C0064726573733E2145646974206D656D6F93\r
+:100D8C0072790046203C73746172743E203C656E2F\r
+:100D9C00643E203C76616C75653E2146696C6C2026\r
+:100DAC006D656D6F72790047205B61646472657369\r
+:100DBC00735D21426567696E2F526573756D652091\r
+:100DCC00657865637574696F6E0048203C73746157\r
+:100DDC0072743E203C656E643E2153656E64206FD8\r
+:100DEC007574206D656D6F727920696E20496E7413\r
+:100DFC00656C2048455820666F726D6174004920FF\r
+:100E0C003C706F72743E21496E7075742066726FFF\r
+:100E1C006D20706F7274004C205B6164647265733A\r
+:100E2C00735D214C6F616420696D61676520696E2B\r
+:100E3C00746F206D656D6F7279004D203C61646438\r
+:100E4C00726573733E21446973706C6179206D65B2\r
+:100E5C006D6F727920696E206865782064756D708D\r
+:100E6C0020666F726D6174004F203C706F72743E1F\r
+:100E7C00203C646174613E214F75747075742074EC\r
+:100E8C006F20706F72740052205B72702076616CF0\r
+:100E9C0075655D215365742F446973706C6179209D\r
+:100EAC0070726F6772616D207265676973746572B9\r
+:100EBC00730053204F4E7C4F464621456E61626C49\r
+:100ECC00652F44697361626C6520537562726F752E\r
+:100EDC0074696E652074726163650054204F4E7C9A\r
+:100EEC004F464621456E61626C652F4469736162A1\r
+:100EFC006C65205472616365206D6F6465005520CC\r
+:100F0C005B616464726573735D215365742F44690E\r
+:100F1C0073706C61792070726F6772616D206261A1\r
+:100F2C00736520616464726573730000CDB50FA79F\r
+:100F3C00CA380FC97CCD450F7DF50F0F0F0FCD4E65\r
+:100F4C000FF1E60FFE0ADE2F27C3AA0FE1CD5D0FCE\r
+:100F5C00E97E23A7C8CDAA0FC35D0FCDA30F3AAE70\r
+:100F6C00FFA7C27F0FCDB50FFE1BCA8D01FE20C09F\r
+:100F7C0032AEFFCD380FFE20C8FE1BCA8D01FE0D10\r
+:100F8C00C27F0F9732AEFFC9FE20DA9E0FFE7FDACA\r
+:100F9C00AA0F3E2EC3AA0F3E0DCDAA0F3E0AF5DBBB\r
+:100FAC00090FD2AB0FF1D308C9DB09E602C8DB0885\r
+:100FBC00C9AFD309D309D3093E40D3093E4ED30957\r
+:100FCC003E15D309AFD3043E7CD3053EC0D300C934\r
+:00000001FF\r
diff --git a/software/mon85/mon85-v12-ncb85.lst b/software/mon85/mon85-v12-ncb85.lst
new file mode 100644 (file)
index 0000000..9705bf4
--- /dev/null
@@ -0,0 +1,2150 @@
+ AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 1 - 1/25/2012 21:31:36\r
+\r
+\r
+       1/       0 :                     ;\r
+       2/       0 :                     ; MON85: A software debugger for the 8080/8085 processor\r
+       3/       0 :                     ;\r
+       4/       0 :                     ; Copyright 1979-2007 Dave Dunfield\r
+       5/       0 :                     ; All rights reserved.\r
+       6/       0 :                     ;\r
+       7/       0 :                     ; Version 1.2 - 2012 Roman Borik\r
+       8/       0 :                     ;\r
+       9/       0 :                     ; New in version 1.2\r
+      10/       0 :                     ; - Support for undocumented 8085 instructions.\r
+      11/       0 :                     ;   DSUB B, ARHL, RDEL, LDHI d8, LDSI d8, LHLX D, SHLX D, JNK a16, JK a16, RSTV\r
+      12/       0 :                     ; - Command R displays all flags of F register (SZKA3PVC). If flag is not set\r
+      13/       0 :                     ;   dash '-' is displayed.\r
+      14/       0 :                     ; - Added restart vector RST 8 (0040h) for possibility to handle RSTV call.\r
+      15/       0 :                     ; - Changed TRACE mode. After entering TRACE mode, instruction on actual PC and\r
+      16/       0 :                     ;   content of registers (if it is switched on) are displayed.\r
+      17/       0 :                     ;   Entering a space ' ' executes this instruction, and returns to the 'T>'\r
+      18/       0 :                     ;   prompt with the next instruction.\r
+      19/       0 :                     ; - Instructions LXI, DAD, INX, DCX displays argument 'SP' rather than 'S'.\r
+      20/       0 :                     ; - Commands that requires 1 byte parameter raises error if entered value\r
+      21/       0 :                     ;   not fit to 1 byte.\r
+      22/       0 :                     ; - Command 'C' checks overlap of source and destination block and for copying\r
+      23/       0 :                     ;   uses appropriate direction.\r
+      24/       0 :                     ; - Command 'F' checks <start> and <end> parameters and raises error,\r
+      25/       0 :                     ;   if <end> is lower than <start>.\r
+      26/       0 :                     ; - Added command 'H' to send out memory content in Intel HEX format.\r
+      27/       0 :                     ; - Sending of LF and CR characters were reversed and are sent in the usual\r
+      28/       0 :                     ;   order - CR first and followed by LF.\r
+      29/       0 :                     \r
+      30/       0 :                     \r
+      31/       0 : =0H                 ROM    EQU     0000h           ; Debugger goes here\r
+      32/       0 : =FFA0H              DRAM   EQU     0FFA0h          ; Debugger RAM (96 bytes required)\r
+      33/       0 :                     \r
+      34/       0 :                     ;\r
+      35/       0 :                     ; Debugger data area (in RAM)\r
+      36/       0 :                     ;\r
+      37/    FFA0 :                            ORG     DRAM            ; Monitor data goes here\r
+      38/    FFA0 :                     ;\r
+      39/    FFA0 :                     UBASE: DS      2               ; Base address of user program\r
+      40/    FFA2 :                     HL:    DS      2               ; Saved HL register pair\r
+      41/    FFA4 :                     DE:    DS      2               ; Saved DE register pair\r
+      42/    FFA6 :                     BC:    DS      2               ; Saved BC register pair\r
+      43/    FFA8 :                     PSW:   DS      2               ; Saved PSW (A + CC)\r
+      44/    FFAA :                     SP:    DS      2               ; Saved Stack Pointer\r
+      45/    FFAC :                     PC:    DS      2               ; Saved Program Counter\r
+      46/    FFAE :                     OFLAG: DS      1               ; Output suspended flag\r
+      47/    FFAF :                     TFLAG: DS      1               ; Flag to enable TRACING\r
+      48/    FFB0 :                     SFLAG: DS      1               ; Flag to enable SUBROUTINE tracing\r
+      49/    FFB1 :                     AFLAG: DS      1               ; Flag to enable AUTO REGISTER DISPLAY\r
+      50/    FFB2 :                     BRKTAB:        DS      24              ; Breakpoint table\r
+      51/    FFCA :                     INST:  DS      6               ; Save area for "faking" instructions\r
+      52/    FFD0 :                     BUFFER:        DS      48              ; Input/temp buffer & stack\r
+      53/   10000 : =0H                 DSTACK EQU     $&0FFFFh        ; Debugger stack\r
+      54/   10000 :                     ;\r
+      55/   10000 :                     ; Startup code... Kick off the monitor\r
+      56/   10000 :                     ;\r
+      57/       0 :                            ORG     ROM             ; Debugger code goes here\r
+      58/       0 :                     ;\r
+      59/       0 : 31 00 00                   LXI     SP,DSTACK       ; Set up initial stack pointer\r
+      60/       3 : C3 0B 01                   JMP     TEST            ; Execute main program\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 2 - 1/25/2012 21:31:36\r
+\r
+\r
+      61/       6 :                            DS      2               ; Filler bytes to first int\r
+      62/       8 :                     ;\r
+      63/       8 :                     ; Interrupt handlers for RESTART interrupts\r
+      64/       8 :                     ;\r
+      65/       8 :                     ; Although they RST 1.5, 2.5 and 3.5 vectors are not used by the\r
+      66/       8 :                     ; 8085 hardware,  they are included since the space must contain\r
+      67/       8 :                     ; SOMETHING,  and who knows,  perhaps someone uses them for jump\r
+      68/       8 :                     ; table addresses etc...\r
+      69/       8 :                     ;\r
+      70/       8 :                     ; Restart 1 is the entry point for breakpoints\r
+      71/       8 : C3 5A 00            RST1:  JMP     ENTRY           ; Execute handler\r
+      72/       B :                            DS      1               ; Filler to next int\r
+      73/       C : CD 44 00            RST15: CALL    RSTINT          ; Invoke interrupt\r
+      74/       F : 0C                         DB      12              ; Offset to handler\r
+      75/      10 : CD 44 00            RST2:  CALL    RSTINT          ; Invoke interrupt\r
+      76/      13 : 10                         DB      16              ; Offset to handler\r
+      77/      14 : CD 44 00            RST25: CALL    RSTINT          ; Invoke interrupt\r
+      78/      17 : 14                         DB      20              ; Offset to handler\r
+      79/      18 : CD 44 00            RST3:  CALL    RSTINT          ; Invoke interrupt\r
+      80/      1B : 18                         DB      24              ; Offset to handler\r
+      81/      1C : CD 44 00            RST35: CALL    RSTINT          ; Invoke interrupt\r
+      82/      1F : 1C                         DB      28              ; Offset to handler\r
+      83/      20 : CD 44 00            RST4:  CALL    RSTINT          ; Invoke interrupt\r
+      84/      23 : 20                         DB      32              ; Offset to handler\r
+      85/      24 : CD 44 00            TRAP:  CALL    RSTINT          ; Invoke interrupt\r
+      86/      27 : 24                         DB      36              ; Offset to handler\r
+      87/      28 : CD 44 00            RST5:  CALL    RSTINT          ; Invoke interrupt\r
+      88/      2B : 28                         DB      40              ; Offset to handler\r
+      89/      2C : CD 44 00            RST55: CALL    RSTINT          ; Invoke interrupt\r
+      90/      2F : 2C                         DB      44              ; Offset to handler\r
+      91/      30 : CD 44 00            RST6:  CALL    RSTINT          ; Invoke interrupt\r
+      92/      33 : 30                         DB      48              ; Offset to handler\r
+      93/      34 : CD 44 00            RST65: CALL    RSTINT          ; Invoke interrupt\r
+      94/      37 : 34                         DB      52              ; Offset to handler\r
+      95/      38 : CD 44 00            RST7:  CALL    RSTINT          ; Invoke interrupt\r
+      96/      3B : 38                         DB      56              ; Offset to handler\r
+      97/      3C : CD 44 00            RST75: CALL    RSTINT          ; Invoke interrupt\r
+      98/      3F : 3C                         DB      60              ; Offset to handler\r
+      99/      40 : CD 44 00            RST8:  CALL    RSTINT          ; Invoke interrupt\r
+     100/      43 : 40                         DB      64              ; Offset to handler\r
+     101/      44 :                     ;\r
+     102/      44 :                     ; Process a RESTART interrupt, get offset & vector to code\r
+     103/      44 :                     ; To speed processing, it is assumed that the user program\r
+     104/      44 :                     ; base address begins on a 256 byte page boundary.\r
+     105/      44 :                     ;\r
+     106/      44 : E3                  RSTINT:        XTHL                    ; Save HL, Get PTR to offset\r
+     107/      45 : F5                         PUSH    PSW             ; Save A and CC\r
+     108/      46 : 7E                         MOV     A,M             ; Get offset\r
+     109/      47 : 2A A0 FF                   LHLD    UBASE           ; Get high of user program\r
+     110/      4A : 6F                         MOV     L,A             ; Set low address\r
+     111/      4B : F1                         POP     PSW             ; Restore A & CC\r
+     112/      4C : E3                         XTHL                    ; Restore HL, set \r
+     113/      4D : C9                         RET                     ; Vector to interrupt\r
+     114/      4E :                     ;\r
+     115/      4E :                     ; Register -> text translation tables used by the disassembler. These tables\r
+     116/      4E :                     ; go here (near beginning) so that we can be sure the high address will not\r
+     117/      4E :                     ; cross a page boundary allowing us to index by modifying low address only.\r
+     118/      4E :                     ;\r
+     119/      4E : 42 43 44 45 48 4C   RTAB:  DB      "BCDEHLMA"      ; Table of register names\r
+                    4D 41 \r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 3 - 1/25/2012 21:31:36\r
+\r
+\r
+     120/      56 : 42 44 48 53         RPTAB: DB      "BDHS"          ; Table of register pairs\r
+     121/      5A :                     ;\r
+     122/      5A :                     ; Entry point for breakpoints & program tracing\r
+     123/      5A :                     ;\r
+     124/      5A :                     ; Save the user program registers\r
+     125/      5A : 22 A2 FF            ENTRY: SHLD    HL              ; Save HL\r
+     126/      5D : EB                         XCHG                    ; Get DE\r
+     127/      5E : 22 A4 FF                   SHLD    DE              ; Save DE\r
+     128/      61 : E1                         POP     H               ; Get RET addrss\r
+     129/      62 : 22 AC FF                   SHLD    PC              ; Save PC\r
+     130/      65 : C5                         PUSH    B               ; Copy BC\r
+     131/      66 : E1                         POP     H               ; And get it\r
+     132/      67 : 22 A6 FF                   SHLD    BC              ; Save PC\r
+     133/      6A : F5                         PUSH    PSW             ; Copy PSW\r
+     134/      6B : E1                         POP     H               ; And get it\r
+     135/      6C : 22 A8 FF                   SHLD    PSW             ; Save PSW\r
+     136/      6F : 21 00 00                   LXI     H,0             ; Start with zero\r
+     137/      72 : 39                         DAD     SP              ; Get SP\r
+     138/      73 : 22 AA FF                   SHLD    SP              ; Save SP\r
+     139/      76 : 31 00 00                   LXI     SP,DSTACK       ; Move to our stack\r
+     140/      79 : 2A AC FF                   LHLD    PC              ; Get RET addrss\r
+     141/      7C : 2B                         DCX     H               ; Backup to actual instruction\r
+     142/      7D : 22 AC FF                   SHLD    PC              ; Save PC\r
+     143/      80 : 11 B2 FF                   LXI     D,BRKTAB        ; Point to breakpoint table\r
+     144/      83 : 06 30                      MVI     B,'0'           ; Assume breakpoint #0\r
+     145/      85 :                     ; Search breakpoint table & see if this is a breakpoint\r
+     146/      85 : 1A                  TRYBRK:        LDAX    D               ; Get HIGH byte from table\r
+     147/      86 : 13                         INX     D               ; Advance\r
+     148/      87 : BC                         CMP     H               ; Does it match?\r
+     149/      88 : 1A                         LDAX    D               ; Get LOW byte from table\r
+     150/      89 : 13                         INX     D               ; Advance\r
+     151/      8A : C2 91 00                   JNZ     NOTBRK          ; No, try next\r
+     152/      8D : BD                         CMP     L               ; Does it match?\r
+     153/      8E : CA 9C 00                   JZ      FOUND           ; Yes, we have an entry\r
+     154/      91 : 13                  NOTBRK:        INX     D               ; Skip saved code byte\r
+     155/      92 : 04                         INR     B               ; Advance breakpoint number\r
+     156/      93 : 78                         MOV     A,B             ; Get breakpoint number\r
+     157/      94 : FE 38                      CPI     '0'+8           ; Table exausted\r
+     158/      96 : DA 85 00                   JC      TRYBRK          ; No, keep looking\r
+     159/      99 :                     ; This interrupt is NOT a breakpoint\r
+     160/      99 : C3 B5 00                   JMP     NOBK            ; Enter with no breakpoint\r
+     161/      9C :                     ; This interrupt is a breakpoint, display the message\r
+     162/      9C : CD 58 0F            FOUND: CALL    PRTMSG          ; Output message\r
+     163/      9F : 2A 2A 20 42 72 65          DB      "** Breakpoint ",0\r
+                    61 6B 70 6F 69 6E \r
+                    74 20 00 \r
+     164/      AE : 78                         MOV     A,B             ; Get breakpoint number\r
+     165/      AF : CD AA 0F                   CALL    OUT             ; Output it\r
+     166/      B2 : CD A3 0F                   CALL    CRLF            ; New line\r
+     167/      B5 :                     ; Reenter monitor, first, restore all breakpoint opcodes\r
+     168/      B5 : 21 B2 FF            NOBK:  LXI     H,BRKTAB        ; Point to breakpoint table\r
+     169/      B8 : 06 08                      MVI     B,8             ; 8 breakpoints\r
+     170/      BA : 56                  FIXL:  MOV     D,M             ; Get HIGH address\r
+     171/      BB : 23                         INX     H               ; Advance\r
+     172/      BC : 5E                         MOV     E,M             ; Get LOW address\r
+     173/      BD : 23                         INX     H               ; Advance\r
+     174/      BE : 7A                         MOV     A,D             ; Get high\r
+     175/      BF : B3                         ORA     E               ; Test for ZERO\r
+     176/      C0 : CA C5 00                   JZ      NOFIX           ; Breakpoint is not set\r
+     177/      C3 : 7E                         MOV     A,M             ; Get opcode\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 4 - 1/25/2012 21:31:36\r
+\r
+\r
+     178/      C4 : 12                         STAX    D               ; And patch user code\r
+     179/      C5 : 23                  NOFIX: INX     H               ; Skip opcode\r
+     180/      C6 : 05                         DCR     B               ; Reduce count\r
+     181/      C7 : C2 BA 00                   JNZ     FIXL            ; Not finished, keep going\r
+     182/      CA : 3A AF FF                   LDA     TFLAG           ; Get trace mode flag\r
+     183/      CD : A7                         ANA     A               ; Is it enabled?\r
+     184/      CE : C2 DB 00                   JNZ     TRTB            ; Yes, enter trace mode\r
+     185/      D1 : 3A B1 FF                   LDA     AFLAG           ; Get auto register display flag\r
+     186/      D4 : A7                         ANA     A               ; Is it enabled?\r
+     187/      D5 : C4 13 08                   CNZ     REGDIS          ; Yes, display the registers\r
+     188/      D8 : C3 8D 01                   JMP     REST            ; Enter monitor\r
+     189/      DB :                     ; Prompt for and handle trace mode commands\r
+     190/      DB : CD 58 0F            TRTB:  CALL    PRTMSG          ; Output message\r
+     191/      DE : 54 3E 20 00                DB      "T> ",0         ; Trace mode prompt\r
+     192/      E2 : 2A AC FF                   LHLD    PC              ; Get PC\r
+     193/      E5 : EB                         XCHG                    ; Move to DE\r
+     194/      E6 : CD AA 08                   CALL    DINST           ; Disassemble the instruction\r
+     195/      E9 : CD A3 0F                   CALL    CRLF            ; New line\r
+     196/      EC : 3A B1 FF                   LDA     AFLAG           ; Get auto register display flag\r
+     197/      EF : A7                         ANA     A               ; Is it enabled?\r
+     198/      F0 : C4 13 08                   CNZ     REGDIS          ; Yes, display the registers\r
+     199/      F3 : CD 38 0F            TRL:   CALL    INCHR           ; Get a command character\r
+     200/      F6 : FE 20                      CPI     ' '             ; Execute command?\r
+     201/      F8 : CA 0A 03                   JZ      NOADR           ; Yes, handle it\r
+     202/      FB : FE 1B                      CPI     1Bh             ; ESCAPE?\r
+     203/      FD : CA 8A 01                   JZ      RECR            ; Yes, abort\r
+     204/     100 : FE 3F                      CPI     '?'             ; Register display?\r
+     205/     102 : C2 F3 00                   JNZ     TRL             ; No, ignore it\r
+     206/     105 : CD 13 08                   CALL    REGDIS          ; Display the registers\r
+     207/     108 : C3 DB 00                   JMP     TRTB            ; And go again\r
+     208/     10B :                     ;\r
+     209/     10B :                     ; Main entry point for the 8080 debugger\r
+     210/     10B :                     ;\r
+     211/     10B : CD BD 0F            TEST:  CALL    INIT            ; Set up hardware\r
+     212/     10E : CD 58 0F                   CALL    PRTMSG          ; Output herald message\r
+     213/     111 : 0D 0A                      DB      0Dh,0Ah\r
+     214/     113 : 4D 4F 4E 38 35 20          DB      "MON85 Version 1.2"\r
+                    56 65 72 73 69 6F \r
+                    6E 20 31 2E 32 \r
+     215/     124 : 0D 0A 0A                   DB      0Dh,0Ah,0Ah\r
+     216/     127 : 43 6F 70 79 72 69          DB      "Copyright 1979-2007 Dave Dunfield"\r
+                    67 68 74 20 31 39 \r
+                    37 39 2D 32 30 30 \r
+                    37 20 44 61 76 65 \r
+                    20 44 75 6E 66 69 \r
+                    65 6C 64 \r
+     217/     148 : 0D 0A                      DB      0Dh,0Ah\r
+     218/     14A : 32 30 31 32 20 52          DB      "2012 Roman Borik"\r
+                    6F 6D 61 6E 20 42 \r
+                    6F 72 69 6B \r
+     219/     15A : 0D 0A                      DB      0Dh,0Ah\r
+     220/     15C : 41 6C 6C 20 72 69          DB      "All rights reserved."\r
+                    67 68 74 73 20 72 \r
+                    65 73 65 72 76 65 \r
+                    64 2E \r
+     221/     170 : 0A 00                      DB      0Ah,0\r
+     222/     172 : 21 A0 FF                   LXI     H,UBASE         ; Point to start of reserved RAM\r
+     223/     175 : 0E 60                      MVI     C,(DSTACK-UBASE)&0FFh ; Number of bytes to zero\r
+     224/     177 : 36 00               INIL1: MVI     M,0             ; Clear a byte\r
+     225/     179 : 23                         INX     H               ; Advance\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 5 - 1/25/2012 21:31:36\r
+\r
+\r
+     226/     17A : 0D                         DCR     C               ; Reduce count\r
+     227/     17B : C2 77 01                   JNZ     INIL1           ; Clear em all\r
+     228/     17E : 21 FF FF                   LXI     H,0FFFFh        ; Set flags\r
+     229/     181 : 22 B0 FF                   SHLD    SFLAG           ; Turn on SUBTRACE & AUTOREG\r
+     230/     184 : 21 A0 FF                   LXI     H,UBASE         ; Default user stack (below monitor RAM)\r
+     231/     187 : 22 AA FF                   SHLD    SP              ; Set user SP\r
+     232/     18A :                     ; Newline and prompt for command\r
+     233/     18A : CD A3 0F            RECR:  CALL    CRLF            ; Output a newline\r
+     234/     18D :                     ; Prompt for an input command\r
+     235/     18D : 31 00 00            REST:  LXI     SP,DSTACK       ; Reset stack pointer\r
+     236/     190 : CD 58 0F                   CALL    PRTMSG          ; Output message\r
+     237/     193 : 43 3E 20 00                DB      "C> ",0         ; Command prompt\r
+     238/     197 : CD 67 07                   CALL    INPT            ; Get command character\r
+     239/     19A :                     ; Look up command in table\r
+     240/     19A : 47                         MOV     B,A             ; Save for later\r
+     241/     19B : 21 BB 01                   LXI     H,CTABLE        ; Point to command table\r
+     242/     19E : 7E                  REST1: MOV     A,M             ; Get char\r
+     243/     19F : 23                         INX     H               ; Advance\r
+     244/     1A0 : B8                         CMP     B               ; Do it match?\r
+     245/     1A1 : CA B2 01                   JZ      REST2           ; Yes, go for it\r
+     246/     1A4 : 23                         INX     H               ; Skip HIGH address\r
+     247/     1A5 : 23                         INX     H               ; Skip LOW address\r
+     248/     1A6 : A7                         ANA     A               ; end of table?\r
+     249/     1A7 : C2 9E 01                   JNZ     REST1           ; Its OK\r
+     250/     1AA :                     ; Error has occured, issue message & return for command\r
+     251/     1AA : 3E 3F               ERROR: MVI     A,'?'           ; Error indicator\r
+     252/     1AC : CD AA 0F                   CALL    OUT             ; Display\r
+     253/     1AF : C3 8A 01                   JMP     RECR            ; And wait for command\r
+     254/     1B2 :                     ; We have command, execute it\r
+     255/     1B2 : 13                  REST2: INX     D               ; Skip command character\r
+     256/     1B3 : 7E                         MOV     A,M             ; Get low address\r
+     257/     1B4 : 23                         INX     H               ; Skip to next\r
+     258/     1B5 : 66                         MOV     H,M             ; Get HIGH address\r
+     259/     1B6 : 6F                         MOV     L,A             ; Set LOW\r
+     260/     1B7 : CD B0 07                   CALL    SKIP            ; Set 'Z' of no operands\r
+     261/     1BA : E9                         PCHL                    ; And execute\r
+     262/     1BB :                     ; Table of commands to execute\r
+     263/     1BB : 41                  CTABLE:        DB      'A'             ; Set AUTOREG flag\r
+     264/     1BC : BD 04                      DW      AUTO\r
+     265/     1BE : 42                         DB      'B'             ; Set/Display breakpoint\r
+     266/     1BF : 5E 02                      DW      SETBRK\r
+     267/     1C1 : 43                         DB      'C'             ; Copy memory\r
+     268/     1C2 : 42 05                      DW      COPY\r
+     269/     1C4 : 44                         DB      'D'             ; Disassemble\r
+     270/     1C5 : BD 05                      DW      GODIS\r
+     271/     1C7 : 45                         DB      'E'             ; Edit memory\r
+     272/     1C8 : D8 04                      DW      EDIT\r
+     273/     1CA : 46                         DB      'F'             ; Fill memory\r
+     274/     1CB : 1C 05                      DW      FILL\r
+     275/     1CD : 47                         DB      'G'             ; Go (begin execution)\r
+     276/     1CE : FA 02                      DW      GO\r
+     277/     1D0 : 48                         DB      'H'             ; Send out memory as Intel HEX\r
+     278/     1D1 : ED 05                      DW      SNDHEX\r
+     279/     1D3 : 49                         DB      'I'             ; Input from port\r
+     280/     1D4 : 29 02                      DW      INPUT\r
+     281/     1D6 : 4C                         DB      'L'             ; Load from serial port\r
+     282/     1D7 : 61 06                      DW      LOAD\r
+     283/     1D9 : 4D                         DB      'M'             ; Memory display\r
+     284/     1DA : 7B 05                      DW      MEMRY\r
+     285/     1DC : 4F                         DB      'O'             ; Output to port\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 6 - 1/25/2012 21:31:36\r
+\r
+\r
+     286/     1DD : 48 02                      DW      OUTPUT\r
+     287/     1DF : 52                         DB      'R'             ; Set/Display Registers\r
+     288/     1E0 : 40 04                      DW      REGIST\r
+     289/     1E2 : 53                         DB      'S'             ; Set SUBTRACE flag\r
+     290/     1E3 : C6 04                      DW      SUBON\r
+     291/     1E5 : 54                         DB      'T'             ; Set TRACE mode\r
+     292/     1E6 : CF 04                      DW      TRACE\r
+     293/     1E8 : 55                         DB      'U'             ; Set/Display user base\r
+     294/     1E9 : CF 05                      DW      USRBASE\r
+     295/     1EB : 3F                         DB      '?'             ; Help command\r
+     296/     1EC : F1 01                      DW      HELP\r
+     297/     1EE : 00                         DB      0               ; End of table\r
+     298/     1EF : 8D 01                      DW      REST            ; Handle NULL command\r
+     299/     1F1 :                     ;\r
+     300/     1F1 :                     ; Help command\r
+     301/     1F1 :                     ;\r
+     302/     1F1 : 21 BB 0C            HELP:  LXI     H,HTEXT         ; Point to help text\r
+     303/     1F4 : 97                         SUB     A               ; Get a zero\r
+     304/     1F5 : 32 AE FF                   STA     OFLAG           ; Clear the output flag\r
+     305/     1F8 :                     ; Output each line\r
+     306/     1F8 : 0E 19               HELP1: MVI     C,25            ; Column counter\r
+     307/     1FA : 7E                  HELP2: MOV     A,M             ; Get character\r
+     308/     1FB : 23                         INX     H               ; Advance to next\r
+     309/     1FC : A7                         ANA     A               ; End of line?\r
+     310/     1FD : CA 1E 02                   JZ      HELP4           ; Yes, terminate\r
+     311/     200 : FE 21                      CPI     '!'             ; Separator?\r
+     312/     202 : CA 0C 02                   JZ      HELP3           ; Yes, output\r
+     313/     205 : CD AA 0F                   CALL    OUT             ; Write character\r
+     314/     208 : 0D                         DCR     C               ; Reduce count\r
+     315/     209 : C3 FA 01                   JMP     HELP2           ; Keep going\r
+     316/     20C :                     ; Fill with spaces to discription column\r
+     317/     20C : CD 9B 08            HELP3: CALL    SPACE           ; Output a space\r
+     318/     20F : 0D                         DCR     C               ; Reduce count\r
+     319/     210 : C2 0C 02                   JNZ     HELP3           ; Do them all\r
+     320/     213 : 3E 2D                      MVI     A,'-'           ; Spperator\r
+     321/     215 : CD AA 0F                   CALL    OUT             ; Display\r
+     322/     218 : CD 9B 08                   CALL    SPACE           ; And space over\r
+     323/     21B : C3 FA 01                   JMP     HELP2           ; Output rest of line\r
+     324/     21E :                     ; End of line encountered...\r
+     325/     21E : CD 67 0F            HELP4: CALL    CHKSUS          ; New line\r
+     326/     221 : 7E                         MOV     A,M             ; Get next byte\r
+     327/     222 : A7                         ANA     A               ; End of text?\r
+     328/     223 : C2 F8 01                   JNZ     HELP1           ; Do them all\r
+     329/     226 : C3 8A 01                   JMP     RECR            ; And go home\r
+     330/     229 :                     ;\r
+     331/     229 :                     ; Input from port\r
+     332/     229 :                     ;\r
+     333/     229 : CD CC 07            INPUT: CALL    CALC8           ; Get port number\r
+     334/     22C : 3E DB                      MVI     A,0DBh          ; 'IN' instruction\r
+     335/     22E : 26 C9                      MVI     H,0C9h          ; 'RET' instruction\r
+     336/     230 : 32 CA FF                   STA     INST            ; Set RAM instruction\r
+     337/     233 : 22 CB FF                   SHLD    INST+1          ; Set RAM instruction\r
+     338/     236 : CD 58 0F                   CALL    PRTMSG          ; Output message\r
+     339/     239 : 44 41 54 41 3D 00          DB      "DATA=",0\r
+     340/     23F : CD CA FF                   CALL    INST            ; Perform the read\r
+     341/     242 : CD 45 0F                   CALL    HPR             ; Output it\r
+     342/     245 : C3 8A 01                   JMP     RECR            ; Newline & EXIT\r
+     343/     248 :                     ;\r
+     344/     248 :                     ; Output to port\r
+     345/     248 :                     ;\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 7 - 1/25/2012 21:31:36\r
+\r
+\r
+     346/     248 : CD CC 07            OUTPUT:        CALL    CALC8           ; Get port number\r
+     347/     24B : 3E D3                      MVI     A,0D3h          ; 'OUT' instruction\r
+     348/     24D : 26 C9                      MVI     H,0C9h          ; 'RET' instruction\r
+     349/     24F : 32 CA FF                   STA     INST            ; Set RAM instruction\r
+     350/     252 : 22 CB FF                   SHLD    INST+1          ; Set RAM instruction\r
+     351/     255 : CD CC 07                   CALL    CALC8           ; Get data byte\r
+     352/     258 : CD CA FF                   CALL    INST            ; Output the data\r
+     353/     25B : C3 8D 01                   JMP     REST            ; Back to command prompt\r
+     354/     25E :                     ;\r
+     355/     25E :                     ; Set breakpoint command\r
+     356/     25E :                     ;\r
+     357/     25E : CA 83 02            SETBRK:        JZ      DISBRK          ; No operands, display breakpoints\r
+     358/     261 :                     ; Set a breakpoint\r
+     359/     261 : CD CC 07                   CALL    CALC8           ; Get hex operand\r
+     360/     264 : FE 08                      CPI     8               ; In range?\r
+     361/     266 : D2 AA 01                   JNC     ERROR           ; No, invalud\r
+     362/     269 : 21 AF FF                   LXI     H,BRKTAB-3      ; Point to breakpoint table\r
+     363/     26C : 01 03 00                   LXI     B,3             ; Offset for a breakpoint\r
+     364/     26F : 09                  SBRLP: DAD     B               ; Advance to next breakpoint\r
+     365/     270 : 3D                         DCR     A               ; Reduce count\r
+     366/     271 : F2 6F 02                   JP      SBRLP           ; Go until we are there\r
+     367/     274 : E5                         PUSH    H               ; Save table address\r
+     368/     275 : CD D6 07                   CALL    CALC            ; Get address\r
+     369/     278 : D1                         POP     D               ; Restore address\r
+     370/     279 : EB                         XCHG                    ; D=brkpt address, H=table address\r
+     371/     27A : 72                         MOV     M,D             ; Set HIGH address in table\r
+     372/     27B : 23                         INX     H               ; Advance\r
+     373/     27C : 73                         MOV     M,E             ; Set LOW address in table\r
+     374/     27D : 23                         INX     H               ; Advance\r
+     375/     27E : 1A                         LDAX    D               ; Get opcode from memory\r
+     376/     27F : 77                         MOV     M,A             ; Save in table\r
+     377/     280 : C3 8D 01                   JMP     REST            ; And get next command\r
+     378/     283 :                     ; Display breakpoints\r
+     379/     283 : 11 B2 FF            DISBRK:        LXI     D,BRKTAB        ; Point to breakpoint table\r
+     380/     286 : 06 30                      MVI     B,'0'           ; Begin with breakpoint zero\r
+     381/     288 : 3E 42               DISLP: MVI     A,'B'           ; Lead in character\r
+     382/     28A : CD AA 0F                   CALL    OUT             ; Output\r
+     383/     28D : 78                         MOV     A,B             ; Get breakpoint number\r
+     384/     28E : CD AA 0F                   CALL    OUT             ; Output\r
+     385/     291 : 3E 3D                      MVI     A,'='           ; Seperator character\r
+     386/     293 : CD AA 0F                   CALL    OUT             ; Output\r
+     387/     296 : 1A                         LDAX    D               ; Get HIGH address\r
+     388/     297 : 67                         MOV     H,A             ; Copy\r
+     389/     298 : 13                         INX     D               ; Advance\r
+     390/     299 : 1A                         LDAX    D               ; Get LOW address\r
+     391/     29A : 6F                         MOV     L,A             ; Copy\r
+     392/     29B : B4                         ORA     H               ; Is breakpoint set?\r
+     393/     29C : CA A5 02                   JZ      NOTSET          ; No, don't display\r
+     394/     29F : CD 40 0F                   CALL    HLOUT           ; Output in hex\r
+     395/     2A2 : C3 AD 02                   JMP     GIVLF           ; And proceed\r
+     396/     2A5 :                     ; Breakpoint is not set\r
+     397/     2A5 : CD 58 0F            NOTSET:        CALL    PRTMSG          ; Output message\r
+     398/     2A8 : 2A 2A 2A 2A 00             DB      "****",0        ; Indicate not set\r
+     399/     2AD : 3E 20               GIVLF: MVI     A,' '           ; Get a space\r
+     400/     2AF : CD AA 0F                   CALL    OUT             ; Output\r
+     401/     2B2 : CD AA 0F                   CALL    OUT             ; Output\r
+     402/     2B5 : 78                         MOV     A,B             ; Get breakpoint address\r
+     403/     2B6 : FE 33                      CPI     '0'+3           ; Halfway through?\r
+     404/     2B8 : CC A3 0F                   CZ      CRLF            ; Yes, new line\r
+     405/     2BB : 13                         INX     D               ; Skip low byte\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 8 - 1/25/2012 21:31:36\r
+\r
+\r
+     406/     2BC : 13                         INX     D               ; Skip opcode\r
+     407/     2BD : 04                         INR     B               ; Advance breakpoint number\r
+     408/     2BE : 78                         MOV     A,B             ; Get number again\r
+     409/     2BF : FE 38                      CPI     '0'+8           ; All done?\r
+     410/     2C1 : DA 88 02                   JC      DISLP           ; No, keep going\r
+     411/     2C4 : CD A3 0F                   CALL    CRLF            ; New line\r
+     412/     2C7 : 21 9F 0C                   LXI     H,AUTMSG        ; Message for AFLAG\r
+     413/     2CA : 3A B1 FF                   LDA     AFLAG           ; Get flag state\r
+     414/     2CD : CD E8 02                   CALL    DISON           ; Display ON/OFF indication\r
+     415/     2D0 : 21 A8 0C                   LXI     H,SUBMSG        ; Message for SFLAG\r
+     416/     2D3 : 3A B0 FF                   LDA     SFLAG           ; Get flag state\r
+     417/     2D6 : CD E8 02                   CALL    DISON           ; Display ON/OFF indication\r
+     418/     2D9 : 21 B3 0C                   LXI     H,TRCMSG        ; Message for TFLAG\r
+     419/     2DC : 3A AF FF                   LDA     TFLAG           ; Get flag state\r
+     420/     2DF : CD E8 02                   CALL    DISON           ; Display ON/OFF indication\r
+     421/     2E2 : CD A3 0F                   CALL    CRLF            ; New line\r
+     422/     2E5 : C3 8D 01                   JMP     REST            ; Back for another command\r
+     423/     2E8 :                     ; Display ON/OFF flag state\r
+     424/     2E8 : F5                  DISON: PUSH    PSW             ; Save A\r
+     425/     2E9 : CD 5D 0F                   CALL    PRTSTR          ; Output message\r
+     426/     2EC : F1                         POP     PSW             ; Restore A\r
+     427/     2ED : 21 9B 0C                   LXI     H,OFF           ; Assume OFF\r
+     428/     2F0 : A7                         ANA     A               ; Test A\r
+     429/     2F1 : CA 5D 0F                   JZ      PRTSTR          ; Yes, display OFF\r
+     430/     2F4 : 21 97 0C                   LXI     H,ON            ; Convert to ON\r
+     431/     2F7 : C3 5D 0F                   JMP     PRTSTR          ; And display ON\r
+     432/     2FA :                     ;\r
+     433/     2FA :                     ; GO command, Begin program execution\r
+     434/     2FA :                     ;\r
+     435/     2FA : CA 03 03            GO:    JZ      NOHEX           ; Address not given, assume default\r
+     436/     2FD : CD D6 07                   CALL    CALC            ; Get argument\r
+     437/     300 : 22 AC FF                   SHLD    PC              ; Save new PC value\r
+     438/     303 : 3A AF FF            NOHEX: LDA     TFLAG           ; Get trace flag\r
+     439/     306 : A7                         ANA     A               ; Enabled?\r
+     440/     307 : C2 DB 00                   JNZ     TRTB            ; Yes, wait for prompt\r
+     441/     30A :                     ; Single-step one instruction...\r
+     442/     30A :                     ; Used for first instruction even when NOT tracing, so\r
+     443/     30A :                     ; that we can insert breakpoints\r
+     444/     30A : 97                  NOADR: SUB     A               ; Get NOP\r
+     445/     30B : 67                         MOV     H,A             ; Set high\r
+     446/     30C : 6F                         MOV     L,A             ; Set LOW\r
+     447/     30D : 32 CA FF                   STA     INST            ; Set first byte\r
+     448/     310 : 22 CB FF                   SHLD    INST+1          ; Set second & third\r
+     449/     313 : 2A AC FF                   LHLD    PC              ; Get PC\r
+     450/     316 : EB                         XCHG                    ; Set DE to PC\r
+     451/     317 : CD 37 09                   CALL    LOOK            ; Lookup instruction\r
+     452/     31A : 47                         MOV     B,A             ; Save the TYPE/LENGTH byte\r
+     453/     31B : E6 03                      ANI     03h             ; Mask TYPE, save LENGTH\r
+     454/     31D : 4F                         MOV     C,A             ; Save for count\r
+     455/     31E :                     ; Copy instruction into "faking" area\r
+     456/     31E : 21 CA FF                   LXI     H,INST          ; Point to saved instruction\r
+     457/     321 : 1A                  GOSET: LDAX    D               ; Get byte from code\r
+     458/     322 : 77                         MOV     M,A             ; Save in instruction\r
+     459/     323 : 23                         INX     H               ; Advance output\r
+     460/     324 : 13                         INX     D               ; Advance input\r
+     461/     325 : 0D                         DCR     C               ; Reduce count\r
+     462/     326 : C2 21 03                   JNZ     GOSET           ; Copy it all\r
+     463/     329 : EB                         XCHG                    ; HL = addrss to execute\r
+     464/     32A : 3E C3                      MVI     A,0C3h          ; Get a JMP instruction\r
+     465/     32C : 32 CD FF                   STA     INST+3          ; Set up a JUMP instruction\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 9 - 1/25/2012 21:31:36\r
+\r
+\r
+     466/     32F : 22 CE FF                   SHLD    INST+4          ; Set target address\r
+     467/     332 : 3A AF FF                   LDA     TFLAG           ; Get trace flag\r
+     468/     335 : A7                         ANA     A               ; Are we tracing?\r
+     469/     336 : CA 0A 04                   JZ      NOTRC           ; No, we are not\r
+     470/     339 : C5                         PUSH    B               ; Save TYPE/LENGTH\r
+     471/     33A : 2A CE FF                   LHLD    INST+4          ; Get termination address\r
+     472/     33D : 23                         INX     H               ; Skip this one\r
+     473/     33E : 22 D0 FF                   SHLD    BUFFER          ; Save for "fake" handling\r
+     474/     341 : 21 38 04                   LXI     H,FAKE          ; Point to FAKE routine\r
+     475/     344 : 22 CE FF                   SHLD    INST+4          ; Save new addres\r
+     476/     347 : C1                         POP     B               ; Restore TYPE/LENGTH\r
+     477/     348 :                     ; Simulate any control transfer instruction\r
+     478/     348 : 3A CA FF                   LDA     INST            ; Get instruction\r
+     479/     34B : FE E9                      CPI     0E9h            ; Is it PCHL?\r
+     480/     34D : C2 56 03                   JNZ     NOPCHL          ; No, skip\r
+     481/     350 : 2A A2 FF                   LHLD    HL              ; Get user HL value\r
+     482/     353 : C3 FD 03                   JMP     HLJMP           ; And simulate a jump\r
+     483/     356 : FE CB               NOPCHL:        CPI     0CBh            ; Is it RSTV?\r
+     484/     358 : C2 69 03                   JNZ     NORSTV          ; No, skip\r
+     485/     35B : 3A A8 FF                   LDA     PSW             ; Get status flags\r
+     486/     35E : E6 02                      ANI     2               ; Check V flag\r
+     487/     360 : C2 0A 04                   JNZ     NOTRC           ; Is set, execute instruction\r
+     488/     363 : 32 CA FF                   STA     INST            ; Change to NOP\r
+     489/     366 : C3 0A 04                   JMP     NOTRC           ; Not set, execute NOP\r
+     490/     369 : FE DD               NORSTV:        CPI     0DDh            ; Is it JNK?\r
+     491/     36B : CA 73 03                   JZ      JNKJK           ; Yes, go\r
+     492/     36E : FE FD                      CPI     0FDh            ; Is it JK?\r
+     493/     370 : C2 82 03                   JNZ     NOJNK           ; No, skip\r
+     494/     373 : E6 20               JNKJK: ANI     20h             ; Save K flag from instruction code\r
+     495/     375 : 4F                         MOV     C,A\r
+     496/     376 : 3A A8 FF                   LDA     PSW             ; Get status flags\r
+     497/     379 : E6 20                      ANI     20h             ; Save only K flag\r
+     498/     37B : A9                         XRA     C               ; Compare them\r
+     499/     37C : CA EC 03                   JZ      NOPSH           ; If they are equal, make jump\r
+     500/     37F : C3 0A 04                   JMP     NOTRC           ; No jump \r
+     501/     382 : 78                  NOJNK: MOV     A,B             ; Get TYPE back\r
+     502/     383 : FE 0B                      CPI     0Bh             ; Is it a 'JUMP'\r
+     503/     385 : CA C7 03                   JZ      GOJMP           ; Yes, handle it\r
+     504/     388 : FE 05                      CPI     05h             ; Is it a 'RETURN'\r
+     505/     38A : CA F2 03                   JZ      CALRET          ; Yes, handle it\r
+     506/     38D : E6 F8                      ANI     0F8h            ; Save only conditional bits\r
+     507/     38F : CA 0A 04                   JZ      NOTRC           ; Not conditional, always execute instruction\r
+     508/     392 : E6 08                      ANI     08h             ; Does this test require COMPLEMENTED flags\r
+     509/     394 : 3A A8 FF                   LDA     PSW             ; Get status flags\r
+     510/     397 : CA 9B 03                   JZ      NOCOM           ; No need to complement\r
+     511/     39A : 2F                         CMA                     ; Invert for NOT tests\r
+     512/     39B : 4F                  NOCOM: MOV     C,A             ; Save PSW bits\r
+     513/     39C : 78                         MOV     A,B             ; Get conditon back\r
+     514/     39D : 17                         RAL                     ; Is it SIGN flag?\r
+     515/     39E : DA AF 03                   JC      SIGN            ; Yes, handle it\r
+     516/     3A1 : 17                         RAL                     ; Is it ZERO flag?\r
+     517/     3A2 : DA B5 03                   JC      ZERO            ; Yes, handle it\r
+     518/     3A5 : 17                         RAL                     ; Is it PARITY flag?\r
+     519/     3A6 : DA BB 03                   JC      PARITY          ; Yes, handle it\r
+     520/     3A9 :                     ; This instruction is conditional on the CARRY flag\r
+     521/     3A9 : 79                  CARRY: MOV     A,C             ; Get flag bits\r
+     522/     3AA : E6 01                      ANI     01h             ; Test CARRY flag\r
+     523/     3AC : C3 BE 03                   JMP     ENFLG           ; And proceed\r
+     524/     3AF :                     ; This instruction is conditional on the SIGN flag\r
+     525/     3AF : 79                  SIGN:  MOV     A,C             ; Get flag bits\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 10 - 1/25/2012 21:31:36\r
+\r
+\r
+     526/     3B0 : E6 80                      ANI     80h             ; Test SIGN flag\r
+     527/     3B2 : C3 BE 03                   JMP     ENFLG           ; And proceed\r
+     528/     3B5 :                     ; This instruction is conditional on the ZERO flag\r
+     529/     3B5 : 79                  ZERO:  MOV     A,C             ; Get flag bits\r
+     530/     3B6 : E6 40                      ANI     40h             ; Test ZERO flag\r
+     531/     3B8 : C3 BE 03                   JMP     ENFLG           ; And proceed\r
+     532/     3BB :                     ; This instruction is conditional on the PARITY flag\r
+     533/     3BB : 79                  PARITY:        MOV     A,C             ; Get flag bits\r
+     534/     3BC : E6 04                      ANI     04h             ; Test PARITY flag\r
+     535/     3BE :                     ; Execute conditional instruction\r
+     536/     3BE : CA 0A 04            ENFLG: JZ      NOTRC           ; Not executed\r
+     537/     3C1 : 78                         MOV     A,B             ; Get type back\r
+     538/     3C2 : E6 04                      ANI     04h             ; Is it JUMP\r
+     539/     3C4 : C2 F2 03                   JNZ     CALRET          ; No, try next\r
+     540/     3C7 :                     ; Simulate a JUMP instruction\r
+     541/     3C7 : 3A CA FF            GOJMP: LDA     INST            ; Get instruction\r
+     542/     3CA : FE CD                      CPI     0CDh            ; Is it a CALL\r
+     543/     3CC : CA D6 03                   JZ      PADR            ; Yes\r
+     544/     3CF : E6 C7                      ANI     0C7h            ; Mask conditional\r
+     545/     3D1 : FE C4                      CPI     0C4h            ; Conditional call?\r
+     546/     3D3 : C2 EC 03                   JNZ     NOPSH           ; No, its a jump\r
+     547/     3D6 :                     ; Simulate a subroutine trace\r
+     548/     3D6 : 3A B0 FF            PADR:  LDA     SFLAG           ; Get subroutine tracing flag\r
+     549/     3D9 : A7                         ANA     A               ; Is it set?\r
+     550/     3DA : CA 0A 04                   JZ      NOTRC           ; No, simulate as one instruction\r
+     551/     3DD : 2A D0 FF                   LHLD    BUFFER          ; Get termination address\r
+     552/     3E0 : 2B                         DCX     H               ; Backup\r
+     553/     3E1 : EB                         XCHG                    ; D = address\r
+     554/     3E2 : 2A AA FF                   LHLD    SP              ; Get user SP\r
+     555/     3E5 : 2B                         DCX     H               ; Backup\r
+     556/     3E6 : 72                         MOV     M,D             ; Set HIGH return address\r
+     557/     3E7 : 2B                         DCX     H               ; Backup\r
+     558/     3E8 : 73                         MOV     M,E             ; Set LOW return address\r
+     559/     3E9 : 22 AA FF                   SHLD    SP              ; Resave user SP\r
+     560/     3EC :                     ; Continue simulation of a JUMP type instruction\r
+     561/     3EC : 2A CB FF            NOPSH: LHLD    INST+1          ; Get target address\r
+     562/     3EF : C3 FD 03                   JMP     HLJMP           ; And proceed\r
+     563/     3F2 :                     ; Handle simulation of RETURN instruction\r
+     564/     3F2 : 2A AA FF            CALRET:        LHLD    SP              ; Get sser SP\r
+     565/     3F5 : 5E                         MOV     E,M             ; Get LOW return address\r
+     566/     3F6 : 23                         INX     H               ; Advance\r
+     567/     3F7 : 56                         MOV     D,M             ; Get HIGH return address\r
+     568/     3F8 : 23                         INX     H               ; Advance\r
+     569/     3F9 : 22 AA FF                   SHLD    SP              ; Resave user SP\r
+     570/     3FC : EB                         XCHG                    ; Set HL = address\r
+     571/     3FD :                     ; Simulate a jump to the address in HL\r
+     572/     3FD : 23                  HLJMP: INX     H               ; Advance\r
+     573/     3FE : 22 D0 FF                   SHLD    BUFFER          ; Save new target address\r
+     574/     401 : 97                         SUB     A               ; Get NOP\r
+     575/     402 : 67                         MOV     H,A             ; Set HIGH\r
+     576/     403 : 6F                         MOV     L,A             ; Set LOW\r
+     577/     404 : 32 CA FF                   STA     INST            ; NOP first byte\r
+     578/     407 : 22 CB FF                   SHLD    INST+1          ; NOP second byte\r
+     579/     40A :                     ; Dispatch the user program\r
+     580/     40A :                     ; First, insert any breakpoints into the object code\r
+     581/     40A : 11 B2 FF            NOTRC: LXI     D,BRKTAB        ; Point to breakpoint table\r
+     582/     40D : 0E 08                      MVI     C,8             ; Size of table (in entries)\r
+     583/     40F : 1A                  RESBP: LDAX    D               ; Get a HIGH address\r
+     584/     410 : 67                         MOV     H,A             ; Save for later\r
+     585/     411 : 13                         INX     D               ; Advance\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 11 - 1/25/2012 21:31:36\r
+\r
+\r
+     586/     412 : 1A                         LDAX    D               ; Get low address\r
+     587/     413 : 6F                         MOV     L,A             ; Save for later\r
+     588/     414 : 13                         INX     D               ; Advance\r
+     589/     415 : B4                         ORA     H               ; Is breakpoint enabled?\r
+     590/     416 : CA 1B 04                   JZ      NORES           ; No, its not\r
+     591/     419 : 36 CF                      MVI     M,0CFh          ; Set up a RST 1 breakpoint\r
+     592/     41B : 13                  NORES: INX     D               ; Skip opcode\r
+     593/     41C : 0D                         DCR     C               ; Reduce count\r
+     594/     41D : C2 0F 04                   JNZ     RESBP           ; Do them all\r
+     595/     420 :                     ; Restore the user applications registers\r
+     596/     420 : 2A AA FF                   LHLD    SP              ; Get stack pointer\r
+     597/     423 : F9                         SPHL                    ; Set stack pointer\r
+     598/     424 : 2A A6 FF                   LHLD    BC              ; Get BC\r
+     599/     427 : E5                         PUSH    H               ; Save\r
+     600/     428 : C1                         POP     B               ; And set\r
+     601/     429 : 2A A8 FF                   LHLD    PSW             ; Get PSW\r
+     602/     42C : E5                         PUSH    H               ; Save\r
+     603/     42D : F1                         POP     PSW             ; And set\r
+     604/     42E : 2A A4 FF                   LHLD    DE              ; Get DE\r
+     605/     431 : EB                         XCHG                    ; Set DE\r
+     606/     432 : 2A A2 FF                   LHLD    HL              ; Get HL\r
+     607/     435 : C3 CA FF                   JMP     INST            ; Execute "faked" instruction\r
+     608/     438 :                     ; Trace routine: simulate a breakpoint interrupt\r
+     609/     438 : E5                  FAKE:  PUSH    H               ; Save HL on stack\r
+     610/     439 : 2A D0 FF                   LHLD    BUFFER          ; Get address to execute\r
+     611/     43C : E3                         XTHL                    ; Restore HL, [SP] = address\r
+     612/     43D : C3 5A 00                   JMP     ENTRY           ; Display the registers\r
+     613/     440 :                     ;\r
+     614/     440 :                     ; Display/Change registers\r
+     615/     440 :                     ;\r
+     616/     440 : C2 49 04            REGIST:        JNZ     CHG1            ; Register name to change is given\r
+     617/     443 :                     ; Display registers\r
+     618/     443 : CD 13 08                   CALL    REGDIS          ; Display registers\r
+     619/     446 : C3 8D 01                   JMP     REST            ; And exit\r
+     620/     449 :                     ; Set register value\r
+     621/     449 : 47                  CHG1:  MOV     B,A             ; Save first register name char\r
+     622/     44A : CD BB 07                   CALL    GETCHI          ; Get char (in upper case)\r
+     623/     44D : 4F                         MOV     C,A             ; Save for later\r
+     624/     44E : CA 57 04                   JZ      OKCH            ; End of string\r
+     625/     451 :                     ; Drop extra characters incase 'PSW'\r
+     626/     451 : CD BC 07            CHG2:  CALL    GETCHR          ; Get next\r
+     627/     454 : C2 51 04                   JNZ     CHG2            ; Clean them out\r
+     628/     457 :                     ; Get new value for register\r
+     629/     457 : CD D6 07            OKCH:  CALL    CALC            ; Get new value\r
+     630/     45A : 78                         MOV     A,B             ; Get first char\r
+     631/     45B : FE 48                      CPI     'H'             ; Is it HL pair\r
+     632/     45D : C2 66 04                   JNZ     CDE             ; No, try next\r
+     633/     460 : 22 A2 FF                   SHLD    HL              ; Set HL value\r
+     634/     463 : C3 8D 01                   JMP     REST            ; And proceed\r
+     635/     466 : FE 44               CDE:   CPI     'D'             ; Is it DE pair?\r
+     636/     468 : C2 71 04                   JNZ     CBC             ; No, try next\r
+     637/     46B : 22 A4 FF                   SHLD    DE              ; Set DE value\r
+     638/     46E : C3 8D 01                   JMP     REST            ; And proceed\r
+     639/     471 : FE 42               CBC:   CPI     'B'             ; Is it BC pair?\r
+     640/     473 : C2 7C 04                   JNZ     CSP             ; No, try next\r
+     641/     476 : 22 A6 FF                   SHLD    BC              ; Set BC value\r
+     642/     479 : C3 8D 01                   JMP     REST            ; And proceed\r
+     643/     47C : FE 53               CSP:   CPI     'S'             ; Is it SP?\r
+     644/     47E : C2 87 04                   JNZ     CP              ; No, try next\r
+     645/     481 : 22 AA FF                   SHLD    SP              ; Set SP value\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 12 - 1/25/2012 21:31:36\r
+\r
+\r
+     646/     484 : C3 8D 01                   JMP     REST            ; And proceed\r
+     647/     487 : FE 50               CP:    CPI     'P'             ; Is it PS or PC\r
+     648/     489 : C2 AA 01                   JNZ     ERROR           ; No, error\r
+     649/     48C : 79                         MOV     A,C             ; Get low character\r
+     650/     48D : FE 53                      CPI     'S'             ; Is it PSW?\r
+     651/     48F : C2 98 04                   JNZ     CPC             ; No, try next\r
+     652/     492 : 22 A8 FF                   SHLD    PSW             ; Set new PSW\r
+     653/     495 : C3 8D 01                   JMP     REST            ; And proceed\r
+     654/     498 : FE 43               CPC:   CPI     'C'             ; Is it PC?\r
+     655/     49A : C2 AA 01                   JNZ     ERROR           ; No, error\r
+     656/     49D : 22 AC FF                   SHLD    PC              ; Set new PC\r
+     657/     4A0 : C3 8D 01                   JMP     REST            ; And proceed\r
+     658/     4A3 :                     ; Process an ON/OFF operand\r
+     659/     4A3 : CD B0 07            ONOFF: CALL    SKIP            ; Get next char\r
+     660/     4A6 : FE 4F                      CPI     'O'             ; Must begin with ON\r
+     661/     4A8 : C2 AA 01                   JNZ     ERROR           ; Invalid\r
+     662/     4AB : CD BB 07                   CALL    GETCHI          ; Get next char\r
+     663/     4AE : 06 00                      MVI     B,0             ; Assume OFF\r
+     664/     4B0 : FE 46                      CPI     'F'             ; OFF?\r
+     665/     4B2 : CA BB 04                   JZ      RETON           ; Yes, set it\r
+     666/     4B5 : FE 4E                      CPI     'N'             ; ON?\r
+     667/     4B7 : C2 AA 01                   JNZ     ERROR           ; No, error\r
+     668/     4BA : 05                         DCR     B               ; Convert to FF\r
+     669/     4BB : 78                  RETON: MOV     A,B             ; Save new value\r
+     670/     4BC : C9                         RET\r
+     671/     4BD :                     ;\r
+     672/     4BD :                     ; Turn automatic register display ON or OFF\r
+     673/     4BD :                     ;\r
+     674/     4BD : CD A3 04            AUTO:  CALL    ONOFF           ; Get ON/OFF value\r
+     675/     4C0 : 32 B1 FF                   STA     AFLAG           ; Set AUTOREG flag\r
+     676/     4C3 : C3 8D 01                   JMP     REST            ; And proceed\r
+     677/     4C6 :                     ;\r
+     678/     4C6 :                     ; Turn SUBROUTINE tracing ON or OFF\r
+     679/     4C6 :                     ;\r
+     680/     4C6 : CD A3 04            SUBON: CALL    ONOFF           ; Get ON/OFF value\r
+     681/     4C9 : 32 B0 FF                   STA     SFLAG           ; Set SUBTRACE flag\r
+     682/     4CC : C3 8D 01                   JMP     REST            ; And proceed\r
+     683/     4CF :                     ;\r
+     684/     4CF :                     ; Set TRACE mode ON or OFF\r
+     685/     4CF :                     ;\r
+     686/     4CF : CD A3 04            TRACE: CALL    ONOFF           ; Get ON/OFF value\r
+     687/     4D2 : 32 AF FF                   STA     TFLAG           ; Set TRACE flag\r
+     688/     4D5 : C3 8D 01                   JMP     REST            ; And proceed\r
+     689/     4D8 :                     ;\r
+     690/     4D8 :                     ; Edit memory contents\r
+     691/     4D8 :                     ;\r
+     692/     4D8 : CD D6 07            EDIT:  CALL    CALC            ; Get address\r
+     693/     4DB : CD 40 0F            EDIT1: CALL    HLOUT           ; Display address\r
+     694/     4DE : CD 9B 08                   CALL    SPACE           ; Separator\r
+     695/     4E1 : 7E                         MOV     A,M             ; Get contents\r
+     696/     4E2 : CD 45 0F                   CALL    HPR             ; Output\r
+     697/     4E5 : 3E 3D                      MVI     A,'='           ; Prompt\r
+     698/     4E7 : CD AA 0F                   CALL    OUT             ; Output\r
+     699/     4EA : E5                         PUSH    H               ; Save address\r
+     700/     4EB : CD 67 07                   CALL    INPT            ; Get a value\r
+     701/     4EE : E1                         POP     H               ; Restore address\r
+     702/     4EF : 23                         INX     H               ; Assume advance\r
+     703/     4F0 : CA DB 04                   JZ      EDIT1           ; Null, advance\r
+     704/     4F3 : 2B                         DCX     H               ; Fix mistake\r
+     705/     4F4 : 2B                         DCX     H               ; Assume backup\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 13 - 1/25/2012 21:31:36\r
+\r
+\r
+     706/     4F5 : FE 2D                      CPI     '-'             ; Backup?\r
+     707/     4F7 : CA DB 04                   JZ      EDIT1           ; Yes, backup a byte\r
+     708/     4FA : 23                         INX     H               ; Fix mistake\r
+     709/     4FB : FE 27                      CPI     27h             ; Single quote?\r
+     710/     4FD : C2 0C 05                   JNZ     EDIT3           ; No, try hex value\r
+     711/     500 :                     ; Handle quoted ASCII text\r
+     712/     500 : 13                         INX     D               ; Skip the quote\r
+     713/     501 : 1A                  EDIT2: LDAX    D               ; Get char\r
+     714/     502 : 13                         INX     D               ; Advance input\r
+     715/     503 : A7                         ANA     A               ; End of loop?\r
+     716/     504 : CA DB 04                   JZ      EDIT1           ; Yes, exit\r
+     717/     507 : 77                         MOV     M,A             ; Save it\r
+     718/     508 : 23                         INX     H               ; Advance output\r
+     719/     509 : C3 01 05                   JMP     EDIT2           ; And proceed\r
+     720/     50C :                     ; Handle HEXIDECIMAL values\r
+     721/     50C : E5                  EDIT3: PUSH    H               ; Save address\r
+     722/     50D : CD CC 07                   CALL    CALC8           ; Get HEX value\r
+     723/     510 : E1                         POP     H               ; HL = address\r
+     724/     511 : 77                         MOV     M,A             ; Set value\r
+     725/     512 : 23                         INX     H               ; Advance to next\r
+     726/     513 : CD B0 07                   CALL    SKIP            ; More operands?\r
+     727/     516 : C2 0C 05                   JNZ     EDIT3           ; Get then all\r
+     728/     519 : C3 DB 04                   JMP     EDIT1           ; And continue\r
+     729/     51C :                     ;\r
+     730/     51C :                     ; FIll memory with a value\r
+     731/     51C :                     ;\r
+     732/     51C : CD D6 07            FILL:  CALL    CALC            ; Get starting address\r
+     733/     51F : E5                         PUSH    H               ; Save for later\r
+     734/     520 : CD D6 07                   CALL    CALC            ; Get ending address\r
+     735/     523 : E5                         PUSH    H               ; Save for later\r
+     736/     524 : CD CC 07                   CALL    CALC8           ; Get value\r
+     737/     527 : 4F                         MOV     C,A             ; C = value\r
+     738/     528 : D1                         POP     D\r
+     739/     529 : 13                         INX     D               ; DE = End address+1\r
+     740/     52A : E1                         POP     H               ; HL = Starting address\r
+     741/     52B : CD 3C 05                   CALL    COMP16          ; Is Start<End ?\r
+     742/     52E : D2 AA 01                   JNC     ERROR           ; Yes, bad entry\r
+     743/     531 : 71                  FILL1: MOV     M,C             ; Save one byte\r
+     744/     532 : 23                         INX     H               ; Advance\r
+     745/     533 : CD 3C 05                   CALL    COMP16          ; Test for match\r
+     746/     536 : DA 31 05                   JC      FILL1           ; And proceed\r
+     747/     539 : C3 8D 01                   JMP     REST            ; Back for next\r
+     748/     53C :                     ;\r
+     749/     53C :                     ; 16 bit compare of HL to DE\r
+     750/     53C :                     ;\r
+     751/     53C : 7C                  COMP16:        MOV     A,H             ; Get HIGH\r
+     752/     53D : BA                         CMP     D               ; Match?\r
+     753/     53E : C0                         RNZ                     ; No, we are done\r
+     754/     53F : 7D                         MOV     A,L             ; Get LOW\r
+     755/     540 : BB                         CMP     E               ; Match?\r
+     756/     541 : C9                         RET\r
+     757/     542 :                     ;\r
+     758/     542 :                     ; Copy a block of memory\r
+     759/     542 :                     ;\r
+     760/     542 : CD D6 07            COPY:  CALL    CALC            ; Get SOURCE address\r
+     761/     545 : E5                         PUSH    H               ; Save for later\r
+     762/     546 : CD D6 07                   CALL    CALC            ; Get DEST Address\r
+     763/     549 : E5                         PUSH    H               ; Save for later\r
+     764/     54A : CD D6 07                   CALL    CALC            ; Get size\r
+     765/     54D : 44                         MOV     B,H             ; BC = Size\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 14 - 1/25/2012 21:31:36\r
+\r
+\r
+     766/     54E : 4D                         MOV     C,L\r
+     767/     54F : D1                         POP     D               ; DE = Dest address\r
+     768/     550 : E1                         POP     H               ; HL = Source\r
+     769/     551 : 78                         MOV     A,B             ; Size is zero?\r
+     770/     552 : B1                         ORA     C\r
+     771/     553 : CA 8D 01                   JZ      REST            ; Yes, exit\r
+     772/     556 : CD 3C 05                   CALL    COMP16          ; Compare source and destination address\r
+     773/     559 : DA 69 05                   JC      COPY2           ; Dest > Source, jump\r
+     774/     55C :                            ; Source > Dest\r
+     775/     55C : 7E                  COPY1: MOV     A,M             ; Get byte from source\r
+     776/     55D : 12                         STAX    D               ; Write to dest\r
+     777/     55E : 23                         INX     H               ; Advance source\r
+     778/     55F : 13                         INX     D               ; Advance dest\r
+     779/     560 : 0B                         DCX     B               ; Reduce count\r
+     780/     561 : 79                         MOV     A,C             ; Count is zero ?\r
+     781/     562 : B0                         ORA     B\r
+     782/     563 : C2 5C 05                   JNZ     COPY1           ; No, continue\r
+     783/     566 : C3 8D 01                   JMP     REST\r
+     784/     569 :                            ; Dest > Source\r
+     785/     569 : 09                  COPY2: DAD     B               ; Move source and destination address to end\r
+     786/     56A : 2B                         DCX     H               ; of block\r
+     787/     56B : EB                         XCHG\r
+     788/     56C : 09                         DAD     B\r
+     789/     56D : 2B                         DCX     H\r
+     790/     56E : 1A                  COPY3: LDAX    D               ; Get byte from source\r
+     791/     56F : 77                         MOV     M,A             ; Write to dest\r
+     792/     570 : 1B                         DCX     D               ; Decrement source address\r
+     793/     571 : 2B                         DCX     H               ; Decrement destination address\r
+     794/     572 : 0B                         DCX     B               ; Reduce count\r
+     795/     573 : 79                         MOV     A,C             ; Count is zero ?\r
+     796/     574 : B0                         ORA     B\r
+     797/     575 : C2 6E 05                   JNZ     COPY3           ; No, continue\r
+     798/     578 : C3 8D 01                   JMP     REST\r
+     799/     57B :                     ;\r
+     800/     57B :                     ; Display a block of memory\r
+     801/     57B :                     ;\r
+     802/     57B : CD D6 07            MEMRY: CALL    CALC            ; Get operand\r
+     803/     57E : 97                         SUB     A               ; Get a ZERO\r
+     804/     57F : 32 AE FF                   STA     OFLAG           ; Clear output flag\r
+     805/     582 : CD 95 08            ALOOP: CALL    HLOUT2          ; Display address (in hex) with 2 spaces\r
+     806/     585 : 16 10                      MVI     D,16            ; 16 bytes/line\r
+     807/     587 : E5                         PUSH    H               ; Save address\r
+     808/     588 : 7E                  ALP1:  MOV     A,M             ; Get byte\r
+     809/     589 : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     810/     58C : CD 9B 08                   CALL    SPACE           ; Space over\r
+     811/     58F : 7A                         MOV     A,D             ; Get count\r
+     812/     590 : FE 09                      CPI     9               ; At boundary?\r
+     813/     592 : CC 9B 08                   CZ      SPACE           ; Yes, extra space\r
+     814/     595 : 7A                         MOV     A,D             ; Get count\r
+     815/     596 : E6 07                      ANI     7               ; Mask for low bits\r
+     816/     598 : FE 05                      CPI     5               ; At boundary?\r
+     817/     59A : CC 9B 08                   CZ      SPACE           ; Extra space\r
+     818/     59D : 23                         INX     H               ; Advance address\r
+     819/     59E : 15                         DCR     D               ; Reduce count\r
+     820/     59F : C2 88 05                   JNZ     ALP1            ; Do them all\r
+     821/     5A2 : 16 04                      MVI     D,4             ; # separating spaces\r
+     822/     5A4 : CD 9B 08            AL2:   CALL    SPACE           ; Output a space\r
+     823/     5A7 : 15                         DCR     D               ; Reduce count\r
+     824/     5A8 : C2 A4 05                   JNZ     AL2             ; And proceed\r
+     825/     5AB : E1                         POP     H\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 15 - 1/25/2012 21:31:36\r
+\r
+\r
+     826/     5AC : 16 10                      MVI     D,16            ; 16 chars/display\r
+     827/     5AE : 7E                  AL3:   MOV     A,M             ; Get data byte\r
+     828/     5AF : CD 94 0F                   CALL    OUTP            ; Display (if printable)\r
+     829/     5B2 : 23                         INX     H               ; Advance to next\r
+     830/     5B3 : 15                         DCR     D               ; Reduce count\r
+     831/     5B4 : C2 AE 05                   JNZ     AL3             ; Do them all\r
+     832/     5B7 : CD 67 0F                   CALL    CHKSUS          ; Handle output suspension\r
+     833/     5BA : C3 82 05                   JMP     ALOOP           ; And continue\r
+     834/     5BD :                     ;\r
+     835/     5BD :                     ; Perform disassembly to console\r
+     836/     5BD :                     ;\r
+     837/     5BD : CD D6 07            GODIS: CALL    CALC            ; Get starting address\r
+     838/     5C0 : E5                         PUSH    H               ; Save address\r
+     839/     5C1 : D1                         POP     D               ; Copy to D\r
+     840/     5C2 : 97                         SUB     A               ; Get a zero\r
+     841/     5C3 : 32 AE FF                   STA     OFLAG           ; Clear output flag\r
+     842/     5C6 : CD AA 08            VLOOP: CALL    DINST           ; Display one instruction\r
+     843/     5C9 : CD 67 0F                   CALL    CHKSUS          ; Handle output\r
+     844/     5CC : C3 C6 05                   JMP     VLOOP           ; And proceed\r
+     845/     5CF :                     ;\r
+     846/     5CF :                     ; Set/display user base address\r
+     847/     5CF :                     ;\r
+     848/     5CF : C2 E4 05            USRBASE: JNZ   USRB1           ; Address is given, set it\r
+     849/     5D2 : CD 58 0F                   CALL    PRTMSG          ; Output message\r
+     850/     5D5 : 42 41 53 45 3D 00          DB      "BASE=",0\r
+     851/     5DB : 2A A0 FF                   LHLD    UBASE           ; Get address\r
+     852/     5DE : CD 40 0F                   CALL    HLOUT           ; Output\r
+     853/     5E1 : C3 8A 01                   JMP     RECR            ; New line & exit\r
+     854/     5E4 : CD D6 07            USRB1: CALL    CALC            ; Get operand\r
+     855/     5E7 : 22 A0 FF                   SHLD    UBASE           ; Set the address\r
+     856/     5EA : C3 8D 01                   JMP     REST            ; and return\r
+     857/     5ED :                     ;\r
+     858/     5ED :                     ; Send out as Intel HEX\r
+     859/     5ED :                     ;\r
+     860/     5ED : CD D6 07            SNDHEX:        CALL    CALC            ; Get start address\r
+     861/     5F0 : E5                         PUSH    H               ; Save for later\r
+     862/     5F1 : CD D6 07                   CALL    CALC            ; Get end address\r
+     863/     5F4 : 23                         INX     H               ; HL = end+1\r
+     864/     5F5 : D1                         POP     D               ; DE = start\r
+     865/     5F6 : CD 3C 05                   CALL    COMP16          ; Check for Start > End\r
+     866/     5F9 : DA AA 01                   JC      ERROR           ; Bad entry\r
+     867/     5FC : 7D                         MOV     A,L             ; Compute length\r
+     868/     5FD : 93                         SUB     E\r
+     869/     5FE : 6F                         MOV     L,A\r
+     870/     5FF : 7C                         MOV     A,H\r
+     871/     600 : 9A                         SBB     D\r
+     872/     601 : 67                         MOV     H,A\r
+     873/     602 : EB                         XCHG                    ; HL = start, DE = length\r
+     874/     603 : 7A                  SNDHX1:        MOV     A,D             ; Finish ?\r
+     875/     604 : B3                         ORA     E\r
+     876/     605 : CA 1B 06                   JZ      SNDHX3          ; Yes, jump\r
+     877/     608 : 06 10                      MVI     B,16            ; 16 bytes per record\r
+     878/     60A : 7A                         MOV     A,D             ; Is rest > 16 ?\r
+     879/     60B : B7                         ORA     A\r
+     880/     60C : C2 15 06                   JNZ     SNDHX2          ; No, jump\r
+     881/     60F : 7B                         MOV     A,E\r
+     882/     610 : B8                         CMP     B\r
+     883/     611 : D2 15 06                   JNC     SNDHX2          ; No, jump\r
+     884/     614 : 43                         MOV     B,E             ; Yes, B=rest\r
+     885/     615 : CD 2F 06            SNDHX2:        CALL    SHXRC           ; Send out one record\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 16 - 1/25/2012 21:31:36\r
+\r
+\r
+     886/     618 : C3 03 06                   JMP     SNDHX1          ; continue\r
+     887/     61B :                     ;\r
+     888/     61B : CD 58 0F            SNDHX3:        CALL    PRTMSG\r
+     889/     61E : 3A 30 30 30 30 30          DB      ":00000001FF",0Dh,0Ah,0\r
+                    30 30 31 46 46 0D \r
+                    0A 00 \r
+     890/     62C : C3 8D 01                   JMP     REST\r
+     891/     62F :                     ;\r
+     892/     62F : 3E 3A               SHXRC: MVI     A,':'           ; Start record\r
+     893/     631 : CD AA 0F                   CALL    OUT\r
+     894/     634 : 78                         MOV     A,B             ; Length\r
+     895/     635 : 4F                         MOV     C,A             ; Init checksum\r
+     896/     636 : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     897/     639 : 7C                         MOV     A,H             ; High byte of address \r
+     898/     63A : 81                         ADD     C               ; Include in checksum\r
+     899/     63B : 4F                         MOV     C,A             ; Re-save\r
+     900/     63C : 7C                         MOV     A,H\r
+     901/     63D : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     902/     640 : 7D                         MOV     A,L             ; Low byte of address \r
+     903/     641 : 81                         ADD     C               ; Include in checksum\r
+     904/     642 : 4F                         MOV     C,A             ; Re-save\r
+     905/     643 : 7D                         MOV     A,L\r
+     906/     644 : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     907/     647 : AF                         XRA     A               ; Record type\r
+     908/     648 : CD 45 0F                   CALL    HPR\r
+     909/     64B : 7E                  SHXRC1:        MOV     A,M             ; One byte\r
+     910/     64C : 81                         ADD     C               ; Include in checksum\r
+     911/     64D : 4F                         MOV     C,A             ; Re-save\r
+     912/     64E : 7E                         MOV     A,M\r
+     913/     64F : 23                         INX     H\r
+     914/     650 : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     915/     653 : 1B                         DCX     D               ; Decrement main counter\r
+     916/     654 : 05                         DCR     B               ; Decrement bytes per record counter\r
+     917/     655 : C2 4B 06                   JNZ     SHXRC1\r
+     918/     658 : 79                         MOV     A,C             ; Negate checksum\r
+     919/     659 : 2F                         CMA\r
+     920/     65A : 3C                         INR     A\r
+     921/     65B : CD 45 0F                   CALL    HPR             ; Output in hex\r
+     922/     65E : C3 A3 0F                   JMP     CRLF\r
+     923/     661 :                     ;\r
+     924/     661 :                     ; Download command\r
+     925/     661 :                     ;\r
+     926/     661 : 3E 0F               LOAD:  MVI     A,0Fh           ; Get default initial state\r
+     927/     663 : CA 6E 06                   JZ      LOAD1           ; Address not given...\r
+     928/     666 : CD D6 07                   CALL    CALC            ; Get operand value\r
+     929/     669 : 22 D3 FF                   SHLD    BUFFER+3        ; Save for later calulation\r
+     930/     66C : 3E FF                      MVI     A,0FFh          ; Set new initial state\r
+     931/     66E :                     ; Setup the offset calculator\r
+     932/     66E : 21 00 00            LOAD1: LXI     H,0             ; Assume no offset\r
+     933/     671 : 32 D0 FF                   STA     BUFFER          ; Set mode flag\r
+     934/     674 : 22 D1 FF                   SHLD    BUFFER+1        ; Assume offset is ZERO\r
+     935/     677 :                     ; Download the records\r
+     936/     677 : CD A4 06            LOAD2: CALL    DLREC           ; Get a record\r
+     937/     67A : C2 83 06                   JNZ     DLBAD           ; Report error\r
+     938/     67D : D2 77 06                   JNC     LOAD2           ; Get them all\r
+     939/     680 : C3 94 06                   JMP     DLWAIT          ; And back to monitor\r
+     940/     683 :                     ; Error in receiving download record\r
+     941/     683 : CD 58 0F            DLBAD: CALL    PRTMSG          ; Output message\r
+     942/     686 : 3F 4C 6F 61 64 20          DB      "?Load error"\r
+                    65 72 72 6F 72 \r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 17 - 1/25/2012 21:31:36\r
+\r
+\r
+     943/     691 : 0D 0A 00                   DB      0Dh,0Ah,0\r
+     944/     694 :                     ; Wait till incoming data stream stops\r
+     945/     694 : 0E 00               DLWAIT:        MVI     C,0             ; Initial count\r
+     946/     696 : CD B5 0F            DLWAIT1: CALL  IN              ; Test for input\r
+     947/     699 : A7                         ANA     A               ; Any data\r
+     948/     69A : C2 94 06                   JNZ     DLWAIT          ; Reset count\r
+     949/     69D : 0D                         DCR     C               ; Reduce counter\r
+     950/     69E : C2 96 06                   JNZ     DLWAIT1         ; Keep looking\r
+     951/     6A1 : C3 8D 01                   JMP     REST            ; Back to monitor\r
+     952/     6A4 :                     ;\r
+     953/     6A4 :                     ; Download a record from the serial port\r
+     954/     6A4 :                     ;\r
+     955/     6A4 : CD 38 0F            DLREC: CALL    INCHR           ; Read a character\r
+     956/     6A7 : FE 3A                      CPI     ':'             ; Start of record?\r
+     957/     6A9 : CA EB 06                   JZ      DLINT           ; Download INTEL format\r
+     958/     6AC : FE 53                      CPI     'S'             ; Is it MOTOROLA?\r
+     959/     6AE : C2 A4 06                   JNZ     DLREC           ; No, keep looking\r
+     960/     6B1 :                     ; Download a MOTOROLA HEX format record\r
+     961/     6B1 : CD 38 0F            DLMOT: CALL    INCHR           ; Get next character\r
+     962/     6B4 : FE 30                      CPI     '0'             ; Header record?\r
+     963/     6B6 : CA A4 06                   JZ      DLREC           ; Yes, skip it\r
+     964/     6B9 : FE 39                      CPI     '9'             ; End of file?\r
+     965/     6BB : CA 19 07                   JZ      DLEOF           ; Yes, report EOF\r
+     966/     6BE : FE 31                      CPI     '1'             ; Type 1 (code) record\r
+     967/     6C0 : C2 64 07                   JNZ     DLERR           ; Report error\r
+     968/     6C3 : CD 40 07                   CALL    GETBYT          ; Get length\r
+     969/     6C6 : 4F                         MOV     C,A             ; Start checksum\r
+     970/     6C7 : D6 03                      SUI     3               ; Convert for overhead\r
+     971/     6C9 : 47                         MOV     B,A             ; Save data length\r
+     972/     6CA : CD 40 07                   CALL    GETBYT          ; Get first byte of address\r
+     973/     6CD : 67                         MOV     H,A             ; Set HIGH address\r
+     974/     6CE : 81                         ADD     C               ; Include in checksum\r
+     975/     6CF : 4F                         MOV     C,A             ; And re-save\r
+     976/     6D0 : CD 40 07                   CALL    GETBYT          ; Get next byte of address\r
+     977/     6D3 : 6F                         MOV     L,A             ; Set LOW address\r
+     978/     6D4 : 81                         ADD     C               ; Include in checksum\r
+     979/     6D5 : 4F                         MOV     C,A             ; And re-save\r
+     980/     6D6 : CD 1B 07                   CALL    SETOFF          ; Handle record offsets\r
+     981/     6D9 : CD 40 07            DMOT1: CALL    GETBYT          ; Get a byte of data\r
+     982/     6DC : 77                         MOV     M,A             ; Save in memory\r
+     983/     6DD : 23                         INX     H               ; Advance\r
+     984/     6DE : 81                         ADD     C               ; Include in checksum\r
+     985/     6DF : 4F                         MOV     C,A             ; And re-save\r
+     986/     6E0 : 05                         DCR     B               ; Reduce length\r
+     987/     6E1 : C2 D9 06                   JNZ     DMOT1           ; Keep going\r
+     988/     6E4 : CD 40 07                   CALL    GETBYT          ; Get record checksum\r
+     989/     6E7 : 81                         ADD     C               ; Include calculated checksum\r
+     990/     6E8 : 3C                         INR     A               ; Adjust for test\r
+     991/     6E9 : A7                         ANA     A               ; Clear carry set Z\r
+     992/     6EA : C9                         RET\r
+     993/     6EB :                     ; Download a record in INTEL hex format\r
+     994/     6EB : CD 40 07            DLINT: CALL    GETBYT          ; Get length\r
+     995/     6EE : A7                         ANA     A               ; End of file?\r
+     996/     6EF : CA 19 07                   JZ      DLEOF           ; Yes, handle it\r
+     997/     6F2 : 4F                         MOV     C,A             ; Begin Checksum\r
+     998/     6F3 : 47                         MOV     B,A             ; Record length\r
+     999/     6F4 : CD 40 07                   CALL    GETBYT          ; Get HIGH address\r
+    1000/     6F7 : 67                         MOV     H,A             ; Set HIGH address\r
+    1001/     6F8 : 81                         ADD     C               ; Include in checksum\r
+    1002/     6F9 : 4F                         MOV     C,A             ; Re-save\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 18 - 1/25/2012 21:31:36\r
+\r
+\r
+    1003/     6FA : CD 40 07                   CALL    GETBYT          ; Get LOW address\r
+    1004/     6FD : 6F                         MOV     L,A             ; Set LOW address\r
+    1005/     6FE : 81                         ADD     C               ; Include in checksum\r
+    1006/     6FF : 4F                         MOV     C,A             ; Re-save\r
+    1007/     700 : CD 1B 07                   CALL    SETOFF          ; Handle record offsets\r
+    1008/     703 : CD 40 07                   CALL    GETBYT          ; Get type byte\r
+    1009/     706 : 81                         ADD     C               ; Include in checksum\r
+    1010/     707 : 4F                         MOV     C,A             ; Re-save\r
+    1011/     708 : CD 40 07            DLINT1:        CALL    GETBYT          ; Get data byte\r
+    1012/     70B : 77                         MOV     M,A             ; Save in memory\r
+    1013/     70C : 23                         INX     H               ; Advance to next\r
+    1014/     70D : 81                         ADD     C               ; Include in checksum\r
+    1015/     70E : 4F                         MOV     C,A             ; Resave checksum\r
+    1016/     70F : 05                         DCR     B               ; Reduce count\r
+    1017/     710 : C2 08 07                   JNZ     DLINT1          ; Do entire record\r
+    1018/     713 : CD 40 07                   CALL    GETBYT          ; Get record checksum\r
+    1019/     716 : 81                         ADD     C               ; Add to computed checksum\r
+    1020/     717 : A7                         ANA     A               ; Clear carry, set Z\r
+    1021/     718 : C9                         RET\r
+    1022/     719 :                     ; End of file on download\r
+    1023/     719 : 37                  DLEOF: STC                     ; Set carry, EOF\r
+    1024/     71A : C9                         RET\r
+    1025/     71B :                     ;\r
+    1026/     71B :                     ; Process record offsets for download records\r
+    1027/     71B :                     ;\r
+    1028/     71B : 3A D0 FF            SETOFF:        LDA     BUFFER          ; Get flag\r
+    1029/     71E : A7                         ANA     A               ; Test flag\r
+    1030/     71F : C2 28 07                   JNZ     SETOF1          ; Special case\r
+    1031/     722 :                     ; Not first record, adjust for offset & proceed\r
+    1032/     722 : EB                         XCHG                    ; DE = address\r
+    1033/     723 : 2A D1 FF                   LHLD    BUFFER+1        ; Get offset\r
+    1034/     726 : 19                         DAD     D               ; HL = address + offset\r
+    1035/     727 : C9                         RET\r
+    1036/     728 :                     ; First record, set USER BASE & calculate offset (if any)\r
+    1037/     728 : 3E 00               SETOF1:        MVI     A,0             ; Get zero (NO CC)\r
+    1038/     72A : 32 D0 FF                   STA     BUFFER          ; Clear flag\r
+    1039/     72D : 22 A0 FF                   SHLD    UBASE           ; Set user program base\r
+    1040/     730 : F0                         RP                      ; No more action\r
+    1041/     731 :                     ; Calculate record offset to RAM area\r
+    1042/     731 : EB                         XCHG                    ; DE = address\r
+    1043/     732 : 2A D3 FF                   LHLD    BUFFER+3        ; Get operand\r
+    1044/     735 : 7D                         MOV     A,L             ; Subtract\r
+    1045/     736 : 93                         SUB     E               ; Record\r
+    1046/     737 : 6F                         MOV     L,A             ; From\r
+    1047/     738 : 7C                         MOV     A,H             ; Operand\r
+    1048/     739 : 9A                         SBB     D               ; To get\r
+    1049/     73A : 67                         MOV     H,A             ; Offset\r
+    1050/     73B : 22 D1 FF                   SHLD    BUFFER+1        ; Set new offset\r
+    1051/     73E : 19                         DAD     D               ; Get address\r
+    1052/     73F : C9                         RET\r
+    1053/     740 :                     ;\r
+    1054/     740 :                     ; Gets a byte of HEX data from serial port.\r
+    1055/     740 :                     ;\r
+    1056/     740 : CD 4D 07            GETBYT:        CALL    GETNIB          ; Get first nibble\r
+    1057/     743 : 07                         RLC                     ; Shift into\r
+    1058/     744 : 07                         RLC                     ; Upper nibble\r
+    1059/     745 : 07                         RLC                     ; Of result\r
+    1060/     746 : 07                         RLC                     ; To make room for lower\r
+    1061/     747 : 5F                         MOV     E,A             ; Keep high digit\r
+    1062/     748 : CD 4D 07                   CALL    GETNIB          ; Get second digit\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 19 - 1/25/2012 21:31:36\r
+\r
+\r
+    1063/     74B : B3                         ORA     E               ; Insert high digit\r
+    1064/     74C : C9                         RET\r
+    1065/     74D :                     ; GETS A NIBBLE FROM THE TERMINAL (IN ASCII HEX)\r
+    1066/     74D : CD 38 0F            GETNIB:        CALL    INCHR           ; Get a character\r
+    1067/     750 : D6 30                      SUI     '0'             ; Is it < '0'?\r
+    1068/     752 : DA 62 07                   JC      GETN1           ; Yes, invalid\r
+    1069/     755 : FE 0A                      CPI     10              ; 0-9?\r
+    1070/     757 : D8                         RC                      ; Yes, its OK\r
+    1071/     758 : D6 07                      SUI     7               ; Convert\r
+    1072/     75A : FE 0A                      CPI     10              ; 9-A?\r
+    1073/     75C : DA 62 07                   JC      GETN1           ; Yes, invalid\r
+    1074/     75F : FE 10                      CPI     16              ; A-F?\r
+    1075/     761 : D8                         RC                      ; Yes, its OK\r
+    1076/     762 : D1                  GETN1: POP     D               ; Remove GETNIB RET addr\r
+    1077/     763 : D1                         POP     D               ; Remove GETBYT RET addr\r
+    1078/     764 :                     ; Error during download record\r
+    1079/     764 : F6 FF               DLERR: ORI     0FFh            ; Error indicator\r
+    1080/     766 : C9                         RET\r
+    1081/     767 :                     ;\r
+    1082/     767 :                     ; Read an input line from the console\r
+    1083/     767 :                     ;\r
+    1084/     767 : 21 D0 FF            INPT:  LXI     H,BUFFER        ; Point to input buffer\r
+    1085/     76A : CD 38 0F            INPT1: CALL    INCHR           ; Get a char\r
+    1086/     76D : FE 1B                      CPI     1Bh             ; ESCAPE?\r
+    1087/     76F : CA 8A 01                   JZ      RECR            ; Back for command\r
+    1088/     772 : FE 0D                      CPI     0Dh             ; Carriage return?\r
+    1089/     774 : CA A8 07                   JZ      INPT4           ; Yes, exit\r
+    1090/     777 : 57                         MOV     D,A             ; Save for later\r
+    1091/     778 :                     ; Test for DELETE function\r
+    1092/     778 : FE 7F                      CPI     7Fh             ; Is it delete?\r
+    1093/     77A : CA 93 07                   JZ      INPT3           ; Yes, it is\r
+    1094/     77D : FE 08                      CPI     08h             ; Backspace?\r
+    1095/     77F : CA 93 07                   JZ      INPT3           ; Yes, it is\r
+    1096/     782 :                     ; Insert character in buffer\r
+    1097/     782 : 7D                         MOV     A,L             ; Get low address\r
+    1098/     783 : FE EE                      CPI     (BUFFER&255)+30 ; Beyond end?\r
+    1099/     785 : 3E 07                      MVI     A,7             ; Assume error\r
+    1100/     787 : CA 8D 07                   JZ      INPT2           ; Yes, report error\r
+    1101/     78A : 7A                         MOV     A,D             ; Get char back\r
+    1102/     78B : 77                         MOV     M,A             ; Save in memory\r
+    1103/     78C : 23                         INX     H               ; Advance\r
+    1104/     78D : CD AA 0F            INPT2: CALL    OUT             ; Echo it\r
+    1105/     790 : C3 6A 07                   JMP     INPT1           ; And proceed\r
+    1106/     793 :                     ; Delete last character from buffer\r
+    1107/     793 : 7D                  INPT3: MOV     A,L             ; Get char\r
+    1108/     794 : FE D0                      CPI     BUFFER&255      ; At begining\r
+    1109/     796 : 3E 07                      MVI     A,7             ; Assume error\r
+    1110/     798 : CA 8D 07                   JZ      INPT2           ; Report error\r
+    1111/     79B : E5                         PUSH    H               ; Save H\r
+    1112/     79C : CD 58 0F                   CALL    PRTMSG          ; Output message\r
+    1113/     79F : 08 20 08 00                DB      8,' ',8,0       ; Wipe away character\r
+    1114/     7A3 : E1                         POP     H               ; Restore H\r
+    1115/     7A4 : 2B                         DCX     H               ; Backup\r
+    1116/     7A5 : C3 6A 07                   JMP     INPT1           ; And proceed\r
+    1117/     7A8 :                     ; Terminate the command\r
+    1118/     7A8 : 36 00               INPT4: MVI     M,0             ; Zero terminate\r
+    1119/     7AA : CD A3 0F                   CALL    CRLF            ; New line\r
+    1120/     7AD : 11 D0 FF                   LXI     D,BUFFER        ; Point to input buffer\r
+    1121/     7B0 :                     ; Advance to next non-blank in buffer\r
+    1122/     7B0 : 1A                  SKIP:  LDAX    D               ; Get char from buffer\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 20 - 1/25/2012 21:31:36\r
+\r
+\r
+    1123/     7B1 : 13                         INX     D               ; Advance\r
+    1124/     7B2 : FE 20                      CPI     ' '             ; Space?\r
+    1125/     7B4 : CA B0 07                   JZ      SKIP            ; Yes, keep looking\r
+    1126/     7B7 : 1B                         DCX     D               ; Backup to it\r
+    1127/     7B8 : C3 C0 07                   JMP     TOCAP           ; And convert to upper\r
+    1128/     7BB :                     ;\r
+    1129/     7BB :                     ; Read next character from command & convert to upper case\r
+    1130/     7BB :                     ;\r
+    1131/     7BB : 13                  GETCHI:        INX     D               ; Skip next character\r
+    1132/     7BC : 1A                  GETCHR:        LDAX    D               ; Get char from command line\r
+    1133/     7BD : A7                         ANA     A               ; End of line?\r
+    1134/     7BE : C8                         RZ                      ; Yes, return with it\r
+    1135/     7BF : 13                         INX     D               ; Advance command pointer\r
+    1136/     7C0 :                     ;\r
+    1137/     7C0 :                     ; Convert character in A to uppercase, set Z if SPACE or EOL\r
+    1138/     7C0 :                     ;\r
+    1139/     7C0 : FE 61               TOCAP: CPI     61h             ; Lower case?\r
+    1140/     7C2 : DA C7 07                   JC      TOCAP1          ; Yes, its ok\r
+    1141/     7C5 : E6 5F                      ANI     5Fh             ; Convert to UPPER\r
+    1142/     7C7 : FE 20               TOCAP1:        CPI     ' '             ; Space\r
+    1143/     7C9 : C8                         RZ                      ; Yes, indicate\r
+    1144/     7CA : A7                         ANA     A               ; Set 'Z' if EOL\r
+    1145/     7CB : C9                         RET\r
+    1146/     7CC :                     ;\r
+    1147/     7CC :                     ; Get 8 bit HEX operands to command\r
+    1148/     7CC :                     ;\r
+    1149/     7CC : CD D6 07            CALC8: CALL    CALC            ; Get operand\r
+    1150/     7CF : 7C                         MOV     A,H             ; High byte must be zero\r
+    1151/     7D0 : B7                         ORA     A\r
+    1152/     7D1 : C2 AA 01                   JNZ     ERROR           ; Bad value\r
+    1153/     7D4 : 7D                         MOV     A,L             ; Value also to A\r
+    1154/     7D5 : C9                         RET\r
+    1155/     7D6 :                     ;\r
+    1156/     7D6 :                     ; Get 16 bit HEX operands to command\r
+    1157/     7D6 :                     ;\r
+    1158/     7D6 : C5                  CALC:  PUSH    B               ; Save B-C\r
+    1159/     7D7 : CD B0 07                   CALL    SKIP            ; Find start of operand\r
+    1160/     7DA : 21 00 00                   LXI     H,0             ; Begin with zero value\r
+    1161/     7DD : 4C                         MOV     C,H             ; Clear flag\r
+    1162/     7DE : CD BC 07            CALC1: CALL    GETCHR          ; Get next char\r
+    1163/     7E1 : CA FE 07                   JZ      CALC3           ; End of number\r
+    1164/     7E4 : CD 05 08                   CALL    VALHEX          ; Is it valid hex?\r
+    1165/     7E7 : DA AA 01                   JC      ERROR           ; No, report error\r
+    1166/     7EA : 29                         DAD     H               ; HL = HL*2\r
+    1167/     7EB : 29                         DAD     H               ; HL = HL*4\r
+    1168/     7EC : 29                         DAD     H               ; HL = HL*8\r
+    1169/     7ED : 29                         DAD     H               ; HL = HL*16 (Shift over 4 bits)\r
+    1170/     7EE : D6 30                      SUI     '0'             ; Convert to ASCII\r
+    1171/     7F0 : FE 0A                      CPI     10              ; Decimal number?\r
+    1172/     7F2 : DA F7 07                   JC      CALC2           ; Yes, its ok\r
+    1173/     7F5 : D6 07                      SUI     7               ; Convert to HEX\r
+    1174/     7F7 : B5                  CALC2: ORA     L               ; Include in final value\r
+    1175/     7F8 : 6F                         MOV     L,A             ; Resave low bute\r
+    1176/     7F9 : 0E FF                      MVI     C,0FFh          ; Set flag & indicate we have char\r
+    1177/     7FB : C3 DE 07                   JMP     CALC1           ; And continue\r
+    1178/     7FE :                     ; End of input string was found\r
+    1179/     7FE : 79                  CALC3: MOV     A,C             ; Get flag\r
+    1180/     7FF : C1                         POP     B               ; Restore B-C\r
+    1181/     800 : A7                         ANA     A               ; Was there any digits?\r
+    1182/     801 : CA AA 01                   JZ      ERROR           ; No, invalid\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 21 - 1/25/2012 21:31:36\r
+\r
+\r
+    1183/     804 : C9                         RET\r
+    1184/     805 :                     ; Test for character in A as valid hex\r
+    1185/     805 : FE 30               VALHEX:        CPI     '0'             ; < '0'\r
+    1186/     807 : D8                         RC                      ; Too low\r
+    1187/     808 : FE 47                      CPI     'G'             ; >'F'\r
+    1188/     80A : 3F                         CMC                     ; Set C state\r
+    1189/     80B : D8                         RC                      ; Too high\r
+    1190/     80C : FE 3A                      CPI     3Ah             ; <='9'\r
+    1191/     80E : 3F                         CMC                     ; Set C state\r
+    1192/     80F : D0                         RNC                     ; Yes, its OK\r
+    1193/     810 : FE 41                      CPI     'A'             ; Set C if < 'A'\r
+    1194/     812 : C9                         RET\r
+    1195/     813 :                     ;\r
+    1196/     813 :                     ; Display the user process registers\r
+    1197/     813 :                     ;\r
+    1198/     813 : 2A A6 FF            REGDIS:        LHLD    BC              ; Get saved BC pair\r
+    1199/     816 : 01 43 42                   LXI     B,'BC'          ; And register names\r
+    1200/     819 : CD 88 08                   CALL    OUTPT           ; Output\r
+    1201/     81C : 2A A4 FF                   LHLD    DE              ; Get saved DE pair\r
+    1202/     81F : 01 45 44                   LXI     B,'DE'          ; And register names\r
+    1203/     822 : CD 88 08                   CALL    OUTPT           ; Output\r
+    1204/     825 : 2A A2 FF                   LHLD    HL              ; Get saved HL pair\r
+    1205/     828 : 01 4C 48                   LXI     B,'HL'          ; And register names\r
+    1206/     82B : CD 88 08                   CALL    OUTPT           ; Output\r
+    1207/     82E : 2A AA FF                   LHLD    SP              ; Get saved SP\r
+    1208/     831 : 01 50 53                   LXI     B,'SP'          ; And register name\r
+    1209/     834 : CD 88 08                   CALL    OUTPT           ; Output\r
+    1210/     837 : 2A AC FF                   LHLD    PC              ; Get saved PC\r
+    1211/     83A : 01 43 50                   LXI     B,'PC'          ; And regsiter name\r
+    1212/     83D : CD 88 08                   CALL    OUTPT           ; Output\r
+    1213/     840 : CD 58 0F                   CALL    PRTMSG          ; Output message\r
+    1214/     843 : 20 50 53 57 3D 00          DB      " PSW=",0\r
+    1215/     849 : 2A A8 FF                   LHLD    PSW             ; Get saved PSW\r
+    1216/     84C : CD 95 08                   CALL    HLOUT2          ; Output value (with two spaces)\r
+    1217/     84F : CD 58 0F                   CALL    PRTMSG          ; Output\r
+    1218/     852 : 20 46 4C 41 47 53          DB      " FLAGS=",0\r
+                    3D 00 \r
+    1219/     85A : 2A A7 FF                   LHLD    PSW-1           ; Get Flags to H\r
+    1220/     85D : 06 53                      MVI     B,'S'           ; 'S' flag\r
+    1221/     85F : CD A0 08                   CALL    OUTB            ; Display\r
+    1222/     862 : 06 5A                      MVI     B,'Z'           ; 'Z' flag\r
+    1223/     864 : CD A0 08                   CALL    OUTB            ; Display\r
+    1224/     867 : 06 4B                      MVI     B,'K'           ; 'K' flag\r
+    1225/     869 : CD A0 08                   CALL    OUTB            ; Display\r
+    1226/     86C : 06 41                      MVI     B,'A'           ; 'A' flag\r
+    1227/     86E : CD A0 08                   CALL    OUTB            ; Display\r
+    1228/     871 : 06 33                      MVI     B,'3'           ; 3. bit flag\r
+    1229/     873 : CD A0 08                   CALL    OUTB            ; Display\r
+    1230/     876 : 06 50                      MVI     B,'P'           ; 'P' flag\r
+    1231/     878 : CD A0 08                   CALL    OUTB            ; Display\r
+    1232/     87B : 06 56                      MVI     B,'V'           ; 'V' flag\r
+    1233/     87D : CD A0 08                   CALL    OUTB            ; Display\r
+    1234/     880 : 06 43                      MVI     B,'C'           ; 'C' flag\r
+    1235/     882 : CD A0 08                   CALL    OUTB            ; Display\r
+    1236/     885 : C3 A3 0F                   JMP     CRLF            ; New line & exit\r
+    1237/     888 :                     ; Display contents of a register pair\r
+    1238/     888 : 78                  OUTPT: MOV     A,B             ; Get first char of name\r
+    1239/     889 : CD AA 0F                   CALL    OUT             ; Output\r
+    1240/     88C : 79                         MOV     A,C             ; Get second char of name\r
+    1241/     88D : CD AA 0F                   CALL    OUT             ; Output\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 22 - 1/25/2012 21:31:36\r
+\r
+\r
+    1242/     890 : 3E 3D                      MVI     A,'='           ; Get separator\r
+    1243/     892 : CD AA 0F                   CALL    OUT             ; Output\r
+    1244/     895 : CD 40 0F            HLOUT2:        CALL    HLOUT           ; Output value\r
+    1245/     898 : CD 9B 08                   CALL    SPACE           ; Output a space\r
+    1246/     89B :                     ; Display a space on the console\r
+    1247/     89B : 3E 20               SPACE: MVI     A,' '           ; Get a spave\r
+    1248/     89D : C3 AA 0F                   JMP     OUT             ; Display it\r
+    1249/     8A0 :                     ; Display an individual flag bit B=title, H[7]=bit\r
+    1250/     8A0 : 29                  OUTB:  DAD     H               ; Shift H[7] into carry\r
+    1251/     8A1 : 3E 2D                      MVI     A,'-'           ; Dash for not set flag\r
+    1252/     8A3 : D2 AA 0F                   JNC     OUT             ; Display dash\r
+    1253/     8A6 : 78                         MOV     A,B             ; Get character\r
+    1254/     8A7 : C3 AA 0F                   JMP     OUT             ; And display\r
+    1255/     8AA :                     ;\r
+    1256/     8AA :                     ; Display an instruction in disassembly format\r
+    1257/     8AA :                     ;\r
+    1258/     8AA : D5                  DINST: PUSH    D               ; Save address\r
+    1259/     8AB : 7A                         MOV     A,D             ; Get high value\r
+    1260/     8AC : CD 45 0F                   CALL    HPR             ; Output\r
+    1261/     8AF : 7B                         MOV     A,E             ; Get low address\r
+    1262/     8B0 : CD 45 0F                   CALL    HPR             ; Output\r
+    1263/     8B3 : CD 9B 08                   CALL    SPACE           ; Output a space\r
+    1264/     8B6 : CD 37 09                   CALL    LOOK            ; Lookup instruction\r
+    1265/     8B9 : E6 03                      ANI     03h             ; Save length\r
+    1266/     8BB : F5                         PUSH    PSW             ; Save length\r
+    1267/     8BC : E5                         PUSH    H               ; Save table address\r
+    1268/     8BD : 06 04                      MVI     B,4             ; 4 spaces total\r
+    1269/     8BF : 4F                         MOV     C,A             ; Save count\r
+    1270/     8C0 : 1B                         DCX     D               ; Backup address\r
+    1271/     8C1 :                     ; Display the opcode bytes in HEX\r
+    1272/     8C1 : 13                  VLP1:  INX     D               ; Advance\r
+    1273/     8C2 : 1A                         LDAX    D               ; Get opcode\r
+    1274/     8C3 : CD 45 0F                   CALL    HPR             ; Output in HEX\r
+    1275/     8C6 : CD 9B 08                   CALL    SPACE           ; Separator\r
+    1276/     8C9 : 05                         DCR     B               ; Reduce count\r
+    1277/     8CA : 0D                         DCR     C               ; Reduce count of opcodes\r
+    1278/     8CB : C2 C1 08                   JNZ     VLP1            ; Do them all\r
+    1279/     8CE :                     ; Fill in to boundary\r
+    1280/     8CE : CD 9B 08            VLP2:  CALL    SPACE           ; Space over\r
+    1281/     8D1 : CD 9B 08                   CALL    SPACE           ; Space over\r
+    1282/     8D4 : CD 9B 08                   CALL    SPACE           ; Spave over\r
+    1283/     8D7 : 05                         DCR     B               ; Reduce count\r
+    1284/     8D8 : C2 CE 08                   JNZ     VLP2            ; Do them all\r
+    1285/     8DB :                     ; DISPLAY ASCII equivalent of opcodes\r
+    1286/     8DB : C1                         POP     B               ; Restore table address\r
+    1287/     8DC : F1                         POP     PSW             ; Restore type/length\r
+    1288/     8DD : D1                         POP     D               ; Restore instruction address\r
+    1289/     8DE : D5                         PUSH    D               ; Resave\r
+    1290/     8DF : F5                         PUSH    PSW             ; Resave\r
+    1291/     8E0 : 26 08                      MVI     H,8             ; 8 spaces/field\r
+    1292/     8E2 : E6 0F                      ANI     0Fh             ; Save only length\r
+    1293/     8E4 : 6F                         MOV     L,A             ; Save for later\r
+    1294/     8E5 : 1A                  PCHR:  LDAX    D               ; Get byte from opcode\r
+    1295/     8E6 : 13                         INX     D               ; Advance\r
+    1296/     8E7 : CD 94 0F                   CALL    OUTP            ; Display (if printable)\r
+    1297/     8EA : 25                         DCR     H               ; Reduce field count\r
+    1298/     8EB : 2D                         DCR     L               ; Reduce opcode count\r
+    1299/     8EC : C2 E5 08                   JNZ     PCHR            ; Do them all\r
+    1300/     8EF :                     ; Space over to instruction address\r
+    1301/     8EF : CD 9B 08            SPLP:  CALL    SPACE           ; Output a space\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 23 - 1/25/2012 21:31:36\r
+\r
+\r
+    1302/     8F2 : 25                         DCR     H               ; Reduce count\r
+    1303/     8F3 : C2 EF 08                   JNZ     SPLP            ; Do them all\r
+    1304/     8F6 : 16 06                      MVI     D,6             ; Field width\r
+    1305/     8F8 : 0A                  VLP3:  LDAX    B               ; Get char from table\r
+    1306/     8F9 : A7                         ANA     A               ; End of string?\r
+    1307/     8FA : CA 11 09                   JZ      VOUT1           ; Yes, exit\r
+    1308/     8FD : CD AA 0F                   CALL    OUT             ; Output it\r
+    1309/     900 : 03                         INX     B               ; Advance to next\r
+    1310/     901 : 15                         DCR     D               ; reduce count\r
+    1311/     902 : FE 20                      CPI     ' '             ; end of name?\r
+    1312/     904 : C2 F8 08                   JNZ     VLP3            ; no, keep going\r
+    1313/     907 :                     ; Fill in name field with spaces\r
+    1314/     907 : 15                  VOUT:  DCR     D               ; reduce count\r
+    1315/     908 : CA F8 08                   JZ      VLP3            ; Keep going\r
+    1316/     90B : CD 9B 08                   CALL    SPACE           ; Output a space\r
+    1317/     90E : C3 07 09                   JMP     VOUT            ; And proceed\r
+    1318/     911 :                     ; Output operands for the instruction\r
+    1319/     911 : F1                  VOUT1: POP     PSW             ; Restore type\r
+    1320/     912 : D1                         POP     D               ; Restore instruction address\r
+    1321/     913 : 3D                         DCR     A               ; Is it type1?\r
+    1322/     914 : CA 27 09                   JZ      T1              ; Yes, handle it\r
+    1323/     917 :                     ; Type 2 -  One byte immediate date\r
+    1324/     917 : F5                  T2:    PUSH    PSW             ; Save type\r
+    1325/     918 : 3E 24                      MVI     A,'$'           ; Get HEX indicator\r
+    1326/     91A : CD AA 0F                   CALL    OUT             ; Output\r
+    1327/     91D : F1                         POP     PSW             ; Restore type\r
+    1328/     91E : 3D                         DCR     A               ; Type 2?\r
+    1329/     91F : C2 29 09                   JNZ     T3              ; No, try next\r
+    1330/     922 : 13                         INX     D               ; Advance to data\r
+    1331/     923 : 1A                         LDAX    D               ; Get data\r
+    1332/     924 : CD 45 0F                   CALL    HPR             ; Output in HEX\r
+    1333/     927 :                     ; Type 1 - No operand\r
+    1334/     927 : 13                  T1:    INX     D\r
+    1335/     928 : C9                         RET\r
+    1336/     929 :                     ; Type 3 - Two bytes immediate data\r
+    1337/     929 : 13                  T3:    INX     D               ; Skip to low   \r
+    1338/     92A : 13                         INX     D               ; Skip to high\r
+    1339/     92B : 1A                         LDAX    D               ; Get HIGH\r
+    1340/     92C : CD 45 0F                   CALL    HPR             ; Output\r
+    1341/     92F : 1B                         DCX     D               ; Backup to low\r
+    1342/     930 : 1A                         LDAX    D               ; Get LOW\r
+    1343/     931 : CD 45 0F                   CALL    HPR             ; Output\r
+    1344/     934 : 13                         INX     D               ; Advance to high\r
+    1345/     935 : 13                         INX     D\r
+    1346/     936 : C9                         RET\r
+    1347/     937 :                     ;\r
+    1348/     937 :                     ; Look up instruction in table & return TYPE/LENGTH[A], and string[HL]\r
+    1349/     937 :                     ;\r
+    1350/     937 : D5                  LOOK:  PUSH    D               ; Save DE\r
+    1351/     938 : 1A                         LDAX    D               ; Get opcode\r
+    1352/     939 : 47                         MOV     B,A             ; Save for later\r
+    1353/     93A : 21 A9 09                   LXI     H,ITABLE        ; Point to table\r
+    1354/     93D : 78                  LOOK1: MOV     A,B             ; Get Opcode\r
+    1355/     93E : A6                         ANA     M               ; Mask\r
+    1356/     93F : 23                         INX     H               ; Skip mask\r
+    1357/     940 : BE                         CMP     M               ; Does it match\r
+    1358/     941 : 23                         INX     H               ; Skip opcode\r
+    1359/     942 : CA 4E 09                   JZ      LOOK3           ; Yes, we found it\r
+    1360/     945 :                     ; This wasn't it, advance to the next\r
+    1361/     945 : 7E                  LOOK2: MOV     A,M             ; Get byte\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 24 - 1/25/2012 21:31:36\r
+\r
+\r
+    1362/     946 : 23                         INX     H               ; Advance to next\r
+    1363/     947 : A7                         ANA     A               ; End of string?\r
+    1364/     948 : C2 45 09                   JNZ     LOOK2           ; No, keep looking\r
+    1365/     94B : C3 3D 09                   JMP     LOOK1           ; And continue\r
+    1366/     94E :                     ; We found the instruction, copy over the text description\r
+    1367/     94E : 4E                  LOOK3: MOV     C,M             ; Save type\r
+    1368/     94F : 23                         INX     H               ; Skip type\r
+    1369/     950 : 11 D0 FF                   LXI     D,BUFFER        ; Point to text buffer\r
+    1370/     953 : 7E                  LOOK4: MOV     A,M             ; Get char from source\r
+    1371/     954 : 23                         INX     H               ; Advance to next\r
+    1372/     955 :                     ; Insert a RESTART vector number\r
+    1373/     955 : FE 76                      CPI     'v'             ; Restart vector\r
+    1374/     957 : C2 65 09                   JNZ     LOOK5           ; No, its OK\r
+    1375/     95A : 78                         MOV     A,B             ; Get opcode\r
+    1376/     95B : 0F                         RRC                     ; Shift it\r
+    1377/     95C : 0F                         RRC                     ; Over\r
+    1378/     95D : 0F                         RRC                     ; To low digit\r
+    1379/     95E : E6 07                      ANI     07h             ; Remove trash\r
+    1380/     960 : C6 30                      ADI     '0'             ; Convert to digit\r
+    1381/     962 : C3 9D 09                   JMP     LOOK10          ; And set the character\r
+    1382/     965 :                     ; Insert a register pair name\r
+    1383/     965 : FE 70               LOOK5: CPI     'p'             ; Register PAIR?\r
+    1384/     967 : C2 78 09                   JNZ     LOOK6           ; No, try next\r
+    1385/     96A : 78                         MOV     A,B             ; Get opcode\r
+    1386/     96B : 0F                         RRC                     ; Shift\r
+    1387/     96C : 0F                         RRC                     ; Over into\r
+    1388/     96D : 0F                         RRC                     ; Low digit\r
+    1389/     96E : 0F                         RRC                     ; For lookup\r
+    1390/     96F : E6 03                      ANI     03h             ; Save only RP\r
+    1391/     971 : E5                         PUSH    H               ; Save HL\r
+    1392/     972 : 21 56 00                   LXI     H,RPTAB         ; Point to pair table\r
+    1393/     975 : C3 90 09                   JMP     LOOK9           ; And proceed\r
+    1394/     978 :                     ; Insert destination register name\r
+    1395/     978 : FE 64               LOOK6: CPI     'd'             ; Set destination?\r
+    1396/     97A : C2 84 09                   JNZ     LOOK7           ; No, try next\r
+    1397/     97D : 78                         MOV     A,B             ; Get opcode\r
+    1398/     97E : 0F                         RRC                     ; Shift\r
+    1399/     97F : 0F                         RRC                     ; Into low\r
+    1400/     980 : 0F                         RRC                     ; digit\r
+    1401/     981 : C3 8A 09                   JMP     LOOK8           ; And proceed\r
+    1402/     984 :                     ; Insert source register name\r
+    1403/     984 : FE 73               LOOK7: CPI     's'             ; Source register?\r
+    1404/     986 : C2 9D 09                   JNZ     LOOK10          ; No, its OK\r
+    1405/     989 : 78                         MOV     A,B             ; Get opcode\r
+    1406/     98A :                     ; Lookup a general processor register\r
+    1407/     98A : E6 07               LOOK8: ANI     07h             ; Save only source\r
+    1408/     98C : E5                         PUSH    H               ; Save HL\r
+    1409/     98D : 21 4E 00                   LXI     H,RTAB          ; Point to table\r
+    1410/     990 :                     ; Lookup register in table\r
+    1411/     990 : 85                  LOOK9: ADD     L               ; Offset to value\r
+    1412/     991 : 6F                         MOV     L,A             ; Resave address\r
+    1413/     992 : 7E                         MOV     A,M             ; Get character\r
+    1414/     993 : FE 53                      CPI     'S'             ; 'SP' register ?\r
+    1415/     995 : C2 9C 09                   JNZ     LOOK9A          ; No, skip\r
+    1416/     998 : 12                         STAX    D               ; Save 'S'\r
+    1417/     999 : 13                         INX     D               ; Advance to next\r
+    1418/     99A : 3E 50                      MVI     A,'P'           ; Character 'P'\r
+    1419/     99C : E1                  LOOK9A:        POP     H               ; Restore HL\r
+    1420/     99D :                     ; Save character in destination string\r
+    1421/     99D : 12                  LOOK10:        STAX    D               ; Save value\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 25 - 1/25/2012 21:31:36\r
+\r
+\r
+    1422/     99E : 13                         INX     D               ; Advance to next\r
+    1423/     99F : A7                         ANA     A               ; End of list?\r
+    1424/     9A0 : C2 53 09                   JNZ     LOOK4           ; No, keep copying\r
+    1425/     9A3 :                     ; End of LIST\r
+    1426/     9A3 : 21 D0 FF                   LXI     H,BUFFER        ; Point to description\r
+    1427/     9A6 : 79                         MOV     A,C             ; Get length\r
+    1428/     9A7 : D1                         POP     D               ; Restore DE\r
+    1429/     9A8 : C9                         RET\r
+    1430/     9A9 :                     ;\r
+    1431/     9A9 :                     ; Opcode disassembly table: MASK, OPCODE, TYPE/LENGTH, STRINGZ\r
+    1432/     9A9 :                     ;\r
+    1433/     9A9 : FF FE 02            ITABLE:        DB      0FFh,0FEh,02h\r
+    1434/     9AC : 43 50 49 20 00             DB      "CPI ",0\r
+    1435/     9B1 : FF 3A 03                   DB      0FFh,3Ah,03h\r
+    1436/     9B4 : 4C 44 41 20 00             DB      "LDA ",0\r
+    1437/     9B9 : FF 32 03                   DB      0FFh,32h,03h\r
+    1438/     9BC : 53 54 41 20 00             DB      "STA ",0\r
+    1439/     9C1 : FF 2A 03                   DB      0FFh,2Ah,03h\r
+    1440/     9C4 : 4C 48 4C 44 20 00          DB      "LHLD ",0\r
+    1441/     9CA : FF 22 03                   DB      0FFh,22h,03h\r
+    1442/     9CD : 53 48 4C 44 20 00          DB      "SHLD ",0\r
+    1443/     9D3 : FF F5 01                   DB      0FFh,0F5h,01h\r
+    1444/     9D6 : 50 55 53 48 20 50          DB      "PUSH PSW",0\r
+                    53 57 00 \r
+    1445/     9DF : FF F1 01                   DB      0FFh,0F1h,01h\r
+    1446/     9E2 : 50 4F 50 20 50 53          DB      "POP PSW",0\r
+                    57 00 \r
+    1447/     9EA : FF 27 01                   DB      0FFh,27h,01h\r
+    1448/     9ED : 44 41 41 00                DB      "DAA",0\r
+    1449/     9F1 : FF 76 01                   DB      0FFh,76h,01h\r
+    1450/     9F4 : 48 4C 54 00                DB      "HLT",0\r
+    1451/     9F8 : FF FB 01                   DB      0FFh,0FBh,01h\r
+    1452/     9FB : 45 49 00                   DB      "EI",0\r
+    1453/     9FE : FF F3 01                   DB      0FFh,0F3h,01h\r
+    1454/     A01 : 44 49 00                   DB      "DI",0\r
+    1455/     A04 : FF 37 01                   DB      0FFh,37h,01h\r
+    1456/     A07 : 53 54 43 00                DB      "STC",0\r
+    1457/     A0B : FF 3F 01                   DB      0FFh,3Fh,01h\r
+    1458/     A0E : 43 4D 43 00                DB      "CMC",0\r
+    1459/     A12 : FF 2F 01                   DB      0FFh,2Fh,01h\r
+    1460/     A15 : 43 4D 41 00                DB      "CMA",0\r
+    1461/     A19 : FF EB 01                   DB      0FFh,0EBh,01h\r
+    1462/     A1C : 58 43 48 47 00             DB      "XCHG",0\r
+    1463/     A21 : FF E3 01                   DB      0FFh,0E3h,01h\r
+    1464/     A24 : 58 54 48 4C 00             DB      "XTHL",0\r
+    1465/     A29 : FF F9 01                   DB      0FFh,0F9h,01h\r
+    1466/     A2C : 53 50 48 4C 00             DB      "SPHL",0\r
+    1467/     A31 : FF E9 01                   DB      0FFh,0E9h,01h\r
+    1468/     A34 : 50 43 48 4C 00             DB      "PCHL",0\r
+    1469/     A39 : FF DB 02                   DB      0FFh,0DBh,02h\r
+    1470/     A3C : 49 4E 20 00                DB      "IN ",0\r
+    1471/     A40 : FF D3 02                   DB      0FFh,0D3h,02h\r
+    1472/     A43 : 4F 55 54 20 00             DB      "OUT ",0\r
+    1473/     A48 : FF 07 01                   DB      0FFh,07h,01h\r
+    1474/     A4B : 52 4C 43 00                DB      "RLC",0\r
+    1475/     A4F : FF 0F 01                   DB      0FFh,0Fh,01h\r
+    1476/     A52 : 52 52 43 00                DB      "RRC",0\r
+    1477/     A56 : FF 17 01                   DB      0FFh,17h,01h\r
+    1478/     A59 : 52 41 4C 00                DB      "RAL",0\r
+    1479/     A5D : FF 1F 01                   DB      0FFh,1Fh,01h\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 26 - 1/25/2012 21:31:36\r
+\r
+\r
+    1480/     A60 : 52 41 52 00                DB      "RAR",0\r
+    1481/     A64 : FF C6 02                   DB      0FFh,0C6h,02h\r
+    1482/     A67 : 41 44 49 20 00             DB      "ADI ",0\r
+    1483/     A6C : FF CE 02                   DB      0FFh,0CEh,02h\r
+    1484/     A6F : 41 43 49 20 00             DB      "ACI ",0\r
+    1485/     A74 : FF D6 02                   DB      0FFh,0D6h,02h\r
+    1486/     A77 : 53 55 49 20 00             DB      "SUI ",0\r
+    1487/     A7C : FF DE 02                   DB      0FFh,0DEh,02h\r
+    1488/     A7F : 53 42 49 20 00             DB      "SBI ",0\r
+    1489/     A84 : FF E6 02                   DB      0FFh,0E6h,02h\r
+    1490/     A87 : 41 4E 49 20 00             DB      "ANI ",0\r
+    1491/     A8C : FF F6 02                   DB      0FFh,0F6h,02h\r
+    1492/     A8F : 4F 52 49 20 00             DB      "ORI ",0\r
+    1493/     A94 : FF EE 02                   DB      0FFh,0EEh,02h\r
+    1494/     A97 : 58 52 49 20 00             DB      "XRI ",0\r
+    1495/     A9C : FF 00 01                   DB      0FFh,00h,01h\r
+    1496/     A9F : 4E 4F 50 00                DB      "NOP",0\r
+    1497/     AA3 :                     ; 8085 specific instructions\r
+    1498/     AA3 : FF 20 01                   DB      0FFh,20h,01h\r
+    1499/     AA6 : 52 49 4D 00                DB      "RIM",0\r
+    1500/     AAA : FF 30 01                   DB      0FFh,30h,01h\r
+    1501/     AAD : 53 49 4D 00                DB      "SIM",0\r
+    1502/     AB1 :                     ; 8085 undocumented instructions\r
+    1503/     AB1 : FF 08 01                   DB      0FFh,08h,01h\r
+    1504/     AB4 : 44 53 55 42 20 42          DB      "DSUB B",0\r
+                    00 \r
+    1505/     ABB : FF 10 01                   DB      0FFh,10h,01h\r
+    1506/     ABE : 41 52 48 4C 00             DB      "ARHL",0\r
+    1507/     AC3 : FF 18 01                   DB      0FFh,18h,01h\r
+    1508/     AC6 : 52 44 45 4C 00             DB      "RDEL",0\r
+    1509/     ACB : FF 28 02                   DB      0FFh,28h,02h\r
+    1510/     ACE : 4C 44 48 49 20 00          DB      "LDHI ",0\r
+    1511/     AD4 : FF 38 02                   DB      0FFh,38h,02h\r
+    1512/     AD7 : 4C 44 53 49 20 00          DB      "LDSI ",0\r
+    1513/     ADD : FF CB 01                   DB      0FFh,0CBh,01h\r
+    1514/     AE0 : 52 53 54 56 00             DB      "RSTV",0\r
+    1515/     AE5 : FF D9 01                   DB      0FFh,0D9h,01h\r
+    1516/     AE8 : 53 48 4C 58 20 44          DB      "SHLX D",0\r
+                    00 \r
+    1517/     AEF : FF DD 03                   DB      0FFh,0DDh,03h\r
+    1518/     AF2 : 4A 4E 4B 20 00             DB      "JNK ",0\r
+    1519/     AF7 : FF ED 01                   DB      0FFh,0EDh,01h\r
+    1520/     AFA : 4C 48 4C 58 20 44          DB      "LHLX D",0\r
+                    00 \r
+    1521/     B01 : FF FD 03                   DB      0FFh,0FDh,03h\r
+    1522/     B04 : 4A 4B 20 00                DB      "JK ",0\r
+    1523/     B08 :                     ; Jumps, Calls & Returns\r
+    1524/     B08 : FF C3 0B                   DB      0FFh,0C3h,0Bh\r
+    1525/     B0B : 4A 4D 50 20 00             DB      "JMP ",0\r
+    1526/     B10 : FF CA 43                   DB      0FFh,0CAh,43h\r
+    1527/     B13 : 4A 5A 20 00                DB      "JZ ",0\r
+    1528/     B17 : FF C2 4B                   DB      0FFh,0C2h,4Bh\r
+    1529/     B1A : 4A 4E 5A 20 00             DB      "JNZ ",0\r
+    1530/     B1F : FF DA 13                   DB      0FFh,0DAh,13h\r
+    1531/     B22 : 4A 43 20 00                DB      "JC ",0\r
+    1532/     B26 : FF D2 1B                   DB      0FFh,0D2h,1Bh\r
+    1533/     B29 : 4A 4E 43 20 00             DB      "JNC ",0\r
+    1534/     B2E : FF EA 23                   DB      0FFh,0EAh,23h\r
+    1535/     B31 : 4A 50 45 20 00             DB      "JPE ",0\r
+    1536/     B36 : FF E2 2B                   DB      0FFh,0E2h,2Bh\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 27 - 1/25/2012 21:31:36\r
+\r
+\r
+    1537/     B39 : 4A 50 4F 20 00             DB      "JPO ",0\r
+    1538/     B3E : FF FA 83                   DB      0FFh,0FAh,83h\r
+    1539/     B41 : 4A 4D 20 00                DB      "JM ",0\r
+    1540/     B45 : FF F2 8B                   DB      0FFh,0F2h,8Bh\r
+    1541/     B48 : 4A 50 20 00                DB      "JP ",0\r
+    1542/     B4C : FF CD 0B                   DB      0FFh,0CDh,0Bh\r
+    1543/     B4F : 43 41 4C 4C 20 00          DB      "CALL ",0\r
+    1544/     B55 : FF CC 43                   DB      0FFh,0CCh,43h\r
+    1545/     B58 : 43 5A 20 00                DB      "CZ ",0\r
+    1546/     B5C : FF C4 4B                   DB      0FFh,0C4h,4Bh\r
+    1547/     B5F : 43 4E 5A 20 00             DB      "CNZ ",0\r
+    1548/     B64 : FF DC 13                   DB      0FFh,0DCh,13h\r
+    1549/     B67 : 43 43 20 00                DB      "CC ",0\r
+    1550/     B6B : FF D4 1B                   DB      0FFh,0D4h,1Bh\r
+    1551/     B6E : 43 4E 43 20 00             DB      "CNC ",0\r
+    1552/     B73 : FF EC 23                   DB      0FFh,0ECh,23h\r
+    1553/     B76 : 43 50 45 20 00             DB      "CPE ",0\r
+    1554/     B7B : FF E4 2B                   DB      0FFh,0E4h,2Bh\r
+    1555/     B7E : 43 50 4F 20 00             DB      "CPO ",0\r
+    1556/     B83 : FF FC 83                   DB      0FFh,0FCh,83h\r
+    1557/     B86 : 43 4D 20 00                DB      "CM ",0\r
+    1558/     B8A : FF F4 8B                   DB      0FFh,0F4h,8Bh\r
+    1559/     B8D : 43 50 20 00                DB      "CP ",0\r
+    1560/     B91 : FF C9 05                   DB      0FFh,0C9h,05h\r
+    1561/     B94 : 52 45 54 00                DB      "RET",0\r
+    1562/     B98 : FF C8 45                   DB      0FFh,0C8h,45h\r
+    1563/     B9B : 52 5A 00                   DB      "RZ",0\r
+    1564/     B9E : FF C0 4D                   DB      0FFh,0C0h,4Dh\r
+    1565/     BA1 : 52 4E 5A 00                DB      "RNZ",0\r
+    1566/     BA5 : FF D8 15                   DB      0FFh,0D8h,15h\r
+    1567/     BA8 : 52 43 00                   DB      "RC",0\r
+    1568/     BAB : FF D0 1D                   DB      0FFh,0D0h,1Dh\r
+    1569/     BAE : 52 4E 43 00                DB      "RNC",0\r
+    1570/     BB2 : FF E8 25                   DB      0FFh,0E8h,25h\r
+    1571/     BB5 : 52 50 45 00                DB      "RPE",0\r
+    1572/     BB9 : FF E0 2D                   DB      0FFh,0E0h,2Dh\r
+    1573/     BBC : 52 50 4F 00                DB      "RPO",0\r
+    1574/     BC0 : FF F8 85                   DB      0FFh,0F8h,85h\r
+    1575/     BC3 : 52 4D 00                   DB      "RM",0\r
+    1576/     BC6 : FF F0 8D                   DB      0FFh,0F0h,8Dh\r
+    1577/     BC9 : 52 50 00                   DB      "RP",0\r
+    1578/     BCC :                     ; Register based instructions\r
+    1579/     BCC : C0 40 01                   DB      0C0h,40h,01h\r
+    1580/     BCF : 4D 4F 56 20 64 2C          DB      "MOV d,s",0\r
+                    73 00 \r
+    1581/     BD7 : C7 06 02                   DB      0C7h,06h,02h\r
+    1582/     BDA : 4D 56 49 20 64 2C          DB      "MVI d,",0\r
+                    00 \r
+    1583/     BE1 : F8 90 01                   DB      0F8h,90h,01h\r
+    1584/     BE4 : 53 55 42 20 73 00          DB      "SUB s",0\r
+    1585/     BEA : F8 98 01                   DB      0F8h,98h,01h\r
+    1586/     BED : 53 42 42 20 73 00          DB      "SBB s",0\r
+    1587/     BF3 : F8 80 01                   DB      0F8h,80h,01h\r
+    1588/     BF6 : 41 44 44 20 73 00          DB      "ADD s",0\r
+    1589/     BFC : F8 88 01                   DB      0F8h,88h,01h\r
+    1590/     BFF : 41 44 43 20 73 00          DB      "ADC s",0\r
+    1591/     C05 : F8 A0 01                   DB      0F8h,0A0h,01h\r
+    1592/     C08 : 41 4E 41 20 73 00          DB      "ANA s",0\r
+    1593/     C0E : F8 B0 01                   DB      0F8h,0B0h,01h\r
+    1594/     C11 : 4F 52 41 20 73 00          DB      "ORA s",0\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 28 - 1/25/2012 21:31:36\r
+\r
+\r
+    1595/     C17 : F8 A8 01                   DB      0F8h,0A8h,01h\r
+    1596/     C1A : 58 52 41 20 73 00          DB      "XRA s",0\r
+    1597/     C20 : F8 B8 01                   DB      0F8h,0B8h,01h\r
+    1598/     C23 : 43 4D 50 20 73 00          DB      "CMP s",0\r
+    1599/     C29 : C7 04 01                   DB      0C7h,04h,01h\r
+    1600/     C2C : 49 4E 52 20 64 00          DB      "INR d",0\r
+    1601/     C32 : C7 05 01                   DB      0C7h,05h,01h\r
+    1602/     C35 : 44 43 52 20 64 00          DB      "DCR d",0\r
+    1603/     C3B :                     ; Register pair instructions\r
+    1604/     C3B : CF 01 03                   DB      0CFh,01h,03h\r
+    1605/     C3E : 4C 58 49 20 70 2C          DB      "LXI p,",0\r
+                    00 \r
+    1606/     C45 : EF 0A 01                   DB      0EFh,0Ah,01h\r
+    1607/     C48 : 4C 44 41 58 20 70          DB      "LDAX p",0\r
+                    00 \r
+    1608/     C4F : EF 02 01                   DB      0EFh,02h,01h\r
+    1609/     C52 : 53 54 41 58 20 70          DB      "STAX p",0\r
+                    00 \r
+    1610/     C59 : CF 03 01                   DB      0CFh,03h,01h\r
+    1611/     C5C : 49 4E 58 20 70 00          DB      "INX p",0\r
+    1612/     C62 : CF 0B 01                   DB      0CFh,0Bh,01h\r
+    1613/     C65 : 44 43 58 20 70 00          DB      "DCX p",0\r
+    1614/     C6B : CF 09 01                   DB      0CFh,09h,01h\r
+    1615/     C6E : 44 41 44 20 70 00          DB      "DAD p",0\r
+    1616/     C74 : CF C5 01                   DB      0CFh,0C5h,01h\r
+    1617/     C77 : 50 55 53 48 20 70          DB      "PUSH p",0\r
+                    00 \r
+    1618/     C7E : CF C1 01                   DB      0CFh,0C1h,01h\r
+    1619/     C81 : 50 4F 50 20 70 00          DB      "POP p",0\r
+    1620/     C87 :                     ; Restart instruction\r
+    1621/     C87 : C7 C7 01                   DB      0C7h,0C7h,01h\r
+    1622/     C8A : 52 53 54 20 76 00          DB      "RST v",0\r
+    1623/     C90 :                     ; This entry always matches invalid opcodes\r
+    1624/     C90 : 00 00 01                   DB      00h,00h,01h\r
+    1625/     C93 : 44 42 20 00                DB      "DB ",0\r
+    1626/     C97 :                     ; Misc Strings and messages\r
+    1627/     C97 : 4F 4E 20 00         ON:    DB      "ON ",0\r
+    1628/     C9B : 4F 46 46 00         OFF:   DB      "OFF",0\r
+    1629/     C9F : 41 55 54 4F 52 45   AUTMSG:        DB      "AUTOREG=",0\r
+                    47 3D 00 \r
+    1630/     CA8 : 20 53 55 42 54 52   SUBMSG:        DB      " SUBTRACE=",0\r
+                    41 43 45 3D 00 \r
+    1631/     CB3 : 20 54 52 41 43 45   TRCMSG:        DB      " TRACE=",0\r
+                    3D 00 \r
+    1632/     CBB : 4D 4F 4E 38 35 20   HTEXT: DB      "MON85 Commands:"\r
+                    43 6F 6D 6D 61 6E \r
+                    64 73 3A \r
+    1633/     CCA : 0D 0A 00                   DB      0Dh,0Ah,0\r
+    1634/     CCD : 41 20 4F 4E 7C 4F          DB      "A ON|OFF!Enable/Disable Automatic register display",0\r
+                    46 46 21 45 6E 61 \r
+                    62 6C 65 2F 44 69 \r
+                    73 61 62 6C 65 20 \r
+                    41 75 74 6F 6D 61 \r
+                    74 69 63 20 72 65 \r
+                    67 69 73 74 65 72 \r
+                    20 64 69 73 70 6C \r
+                    61 79 00 \r
+    1635/     D00 : 42 20 5B 62 70 20          DB      "B [bp address]!Set/Display breakpoints",0\r
+                    61 64 64 72 65 73 \r
+                    73 5D 21 53 65 74 \r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 29 - 1/25/2012 21:31:36\r
+\r
+\r
+                    2F 44 69 73 70 6C \r
+                    61 79 20 62 72 65 \r
+                    61 6B 70 6F 69 6E \r
+                    74 73 00 \r
+    1636/     D27 : 43 20 3C 73 72 63          DB      "C <src> <dest> <size>!Copy memory",0\r
+                    3E 20 3C 64 65 73 \r
+                    74 3E 20 3C 73 69 \r
+                    7A 65 3E 21 43 6F \r
+                    70 79 20 6D 65 6D \r
+                    6F 72 79 00 \r
+    1637/     D49 : 44 20 3C 61 64 64          DB      "D <address>!Display memory in assembly format",0\r
+                    72 65 73 73 3E 21 \r
+                    44 69 73 70 6C 61 \r
+                    79 20 6D 65 6D 6F \r
+                    72 79 20 69 6E 20 \r
+                    61 73 73 65 6D 62 \r
+                    6C 79 20 66 6F 72 \r
+                    6D 61 74 00 \r
+    1638/     D77 : 45 20 3C 61 64 64          DB      "E <address>!Edit memory",0\r
+                    72 65 73 73 3E 21 \r
+                    45 64 69 74 20 6D \r
+                    65 6D 6F 72 79 00 \r
+    1639/     D8F : 46 20 3C 73 74 61          DB      "F <start> <end> <value>!Fill memory",0\r
+                    72 74 3E 20 3C 65 \r
+                    6E 64 3E 20 3C 76 \r
+                    61 6C 75 65 3E 21 \r
+                    46 69 6C 6C 20 6D \r
+                    65 6D 6F 72 79 00 \r
+    1640/     DB3 : 47 20 5B 61 64 64          DB      "G [address]!Begin/Resume execution",0\r
+                    72 65 73 73 5D 21 \r
+                    42 65 67 69 6E 2F \r
+                    52 65 73 75 6D 65 \r
+                    20 65 78 65 63 75 \r
+                    74 69 6F 6E 00 \r
+    1641/     DD6 : 48 20 3C 73 74 61          DB      "H <start> <end>!Send out memory in Intel HEX format",0\r
+                    72 74 3E 20 3C 65 \r
+                    6E 64 3E 21 53 65 \r
+                    6E 64 20 6F 75 74 \r
+                    20 6D 65 6D 6F 72 \r
+                    79 20 69 6E 20 49 \r
+                    6E 74 65 6C 20 48 \r
+                    45 58 20 66 6F 72 \r
+                    6D 61 74 00 \r
+    1642/     E0A : 49 20 3C 70 6F 72          DB      "I <port>!Input from port",0\r
+                    74 3E 21 49 6E 70 \r
+                    75 74 20 66 72 6F \r
+                    6D 20 70 6F 72 74 \r
+                    00 \r
+    1643/     E23 : 4C 20 5B 61 64 64          DB      "L [address]!Load image into memory",0\r
+                    72 65 73 73 5D 21 \r
+                    4C 6F 61 64 20 69 \r
+                    6D 61 67 65 20 69 \r
+                    6E 74 6F 20 6D 65 \r
+                    6D 6F 72 79 00 \r
+    1644/     E46 : 4D 20 3C 61 64 64          DB      "M <address>!Display memory in hex dump format",0\r
+                    72 65 73 73 3E 21 \r
+                    44 69 73 70 6C 61 \r
+                    79 20 6D 65 6D 6F \r
+                    72 79 20 69 6E 20 \r
+                    68 65 78 20 64 75 \r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 30 - 1/25/2012 21:31:36\r
+\r
+\r
+                    6D 70 20 66 6F 72 \r
+                    6D 61 74 00 \r
+    1645/     E74 : 4F 20 3C 70 6F 72          DB      "O <port> <data>!Output to port",0\r
+                    74 3E 20 3C 64 61 \r
+                    74 61 3E 21 4F 75 \r
+                    74 70 75 74 20 74 \r
+                    6F 20 70 6F 72 74 \r
+                    00 \r
+    1646/     E93 : 52 20 5B 72 70 20          DB      "R [rp value]!Set/Display program registers",0\r
+                    76 61 6C 75 65 5D \r
+                    21 53 65 74 2F 44 \r
+                    69 73 70 6C 61 79 \r
+                    20 70 72 6F 67 72 \r
+                    61 6D 20 72 65 67 \r
+                    69 73 74 65 72 73 \r
+                    00 \r
+    1647/     EBE : 53 20 4F 4E 7C 4F          DB      "S ON|OFF!Enable/Disable Subroutine trace",0\r
+                    46 46 21 45 6E 61 \r
+                    62 6C 65 2F 44 69 \r
+                    73 61 62 6C 65 20 \r
+                    53 75 62 72 6F 75 \r
+                    74 69 6E 65 20 74 \r
+                    72 61 63 65 00 \r
+    1648/     EE7 : 54 20 4F 4E 7C 4F          DB      "T ON|OFF!Enable/Disable Trace mode",0\r
+                    46 46 21 45 6E 61 \r
+                    62 6C 65 2F 44 69 \r
+                    73 61 62 6C 65 20 \r
+                    54 72 61 63 65 20 \r
+                    6D 6F 64 65 00 \r
+    1649/     F0A : 55 20 5B 61 64 64          DB      "U [address]!Set/Display program base address",0\r
+                    72 65 73 73 5D 21 \r
+                    53 65 74 2F 44 69 \r
+                    73 70 6C 61 79 20 \r
+                    70 72 6F 67 72 61 \r
+                    6D 20 62 61 73 65 \r
+                    20 61 64 64 72 65 \r
+                    73 73 00 \r
+    1650/     F37 : 00                         DB      0\r
+    1651/     F38 :                     ;\r
+    1652/     F38 :                     ; Read a character, and wait for it\r
+    1653/     F38 :                     ;\r
+    1654/     F38 : CD B5 0F            INCHR: CALL    IN              ; Check for a character\r
+    1655/     F3B : A7                         ANA     A               ; Is there any data?\r
+    1656/     F3C : CA 38 0F                   JZ      INCHR           ; Wait for it\r
+    1657/     F3F : C9                         RET\r
+    1658/     F40 :                     ;\r
+    1659/     F40 :                     ; Display HL in hexidecimal\r
+    1660/     F40 :                     ;\r
+    1661/     F40 : 7C                  HLOUT: MOV     A,H             ; Get HIGH byte\r
+    1662/     F41 : CD 45 0F                   CALL    HPR             ; Output\r
+    1663/     F44 : 7D                         MOV     A,L             ; Get LOW byte\r
+    1664/     F45 :                     ;\r
+    1665/     F45 :                     ; Display A in hexidecimal\r
+    1666/     F45 :                     ;\r
+    1667/     F45 : F5                  HPR:   PUSH    PSW             ; Save low digit\r
+    1668/     F46 : 0F                         RRC                     ; Shift\r
+    1669/     F47 : 0F                         RRC                     ; high\r
+    1670/     F48 : 0F                         RRC                     ; digit\r
+    1671/     F49 : 0F                         RRC                     ; into low\r
+    1672/     F4A : CD 4E 0F                   CALL    HOUT            ; Display a single digit\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 31 - 1/25/2012 21:31:36\r
+\r
+\r
+    1673/     F4D : F1                         POP     PSW             ; Restore low digit\r
+    1674/     F4E : E6 0F               HOUT:  ANI     0Fh             ; Remove high digit\r
+    1675/     F50 : FE 0A                      CPI     10              ; Convert to ASCII\r
+    1676/     F52 : DE 2F                      SBI     2Fh\r
+    1677/     F54 : 27                         DAA\r
+    1678/     F55 : C3 AA 0F                   JMP     OUT             ; And output it\r
+    1679/     F58 :                     ;\r
+    1680/     F58 :                     ; Display message [PC]\r
+    1681/     F58 :                     ;\r
+    1682/     F58 : E1                  PRTMSG:        POP     H               ; Get address\r
+    1683/     F59 : CD 5D 0F                   CALL    PRTSTR          ; Output message\r
+    1684/     F5C : E9                         PCHL                    ; And return\r
+    1685/     F5D :                     ;\r
+    1686/     F5D :                     ; Display message [HL]\r
+    1687/     F5D :                     ;\r
+    1688/     F5D : 7E                  PRTSTR:        MOV     A,M             ; Get byte from message\r
+    1689/     F5E : 23                         INX     H               ; Advance to next\r
+    1690/     F5F : A7                         ANA     A               ; End of message?\r
+    1691/     F60 : C8                         RZ                      ; Yes, exit\r
+    1692/     F61 : CD AA 0F                   CALL    OUT             ; Output the character\r
+    1693/     F64 : C3 5D 0F                   JMP     PRTSTR          ; And proceed\r
+    1694/     F67 :                     ;\r
+    1695/     F67 :                     ; Handle output suspension\r
+    1696/     F67 :                     ;\r
+    1697/     F67 : CD A3 0F            CHKSUS:        CALL    CRLF            ; New line\r
+    1698/     F6A : 3A AE FF                   LDA     OFLAG           ; Is output suspended?\r
+    1699/     F6D : A7                         ANA     A               ; Test flag\r
+    1700/     F6E : C2 7F 0F                   JNZ     CHKS1           ; Yes it is\r
+    1701/     F71 : CD B5 0F                   CALL    IN              ; Test for CONTROL-C interrupt\r
+    1702/     F74 : FE 1B                      CPI     1Bh             ; ESCAPE?\r
+    1703/     F76 : CA 8D 01                   JZ      REST            ; Abort\r
+    1704/     F79 : FE 20                      CPI     ' '             ; SPACE - Suspend command\r
+    1705/     F7B : C0                         RNZ\r
+    1706/     F7C : 32 AE FF                   STA     OFLAG           ; Set the flag\r
+    1707/     F7F :                     ; Output is suspended, wait for command\r
+    1708/     F7F : CD 38 0F            CHKS1: CALL    INCHR           ; Get char\r
+    1709/     F82 : FE 20                      CPI     ' '             ; One line?\r
+    1710/     F84 : C8                         RZ                      ; Allow it\r
+    1711/     F85 : FE 1B                      CPI     1Bh             ; ESCAPE?\r
+    1712/     F87 : CA 8D 01                   JZ      REST            ; Abort\r
+    1713/     F8A : FE 0D                      CPI     0Dh             ; Resume?\r
+    1714/     F8C : C2 7F 0F                   JNZ     CHKS1           ; Keep going\r
+    1715/     F8F : 97                         SUB     A               ; Reset flag\r
+    1716/     F90 : 32 AE FF                   STA     OFLAG           ; Write it\r
+    1717/     F93 : C9                         RET\r
+    1718/     F94 :                     ; Display a character if its printable\r
+    1719/     F94 : FE 20               OUTP:  CPI     ' '             ; < ' '\r
+    1720/     F96 : DA 9E 0F                   JC      OUTP1           ; Invalid, exchange it\r
+    1721/     F99 : FE 7F                      CPI     7Fh             ; Printable?\r
+    1722/     F9B : DA AA 0F                   JC      OUT             ; Ok to display\r
+    1723/     F9E : 3E 2E               OUTP1: MVI     A,'.'           ; Set to DOT to indicate invalid\r
+    1724/     FA0 : C3 AA 0F                   JMP     OUT             ; And display\r
+    1725/     FA3 :                     ;\r
+    1726/     FA3 :                     ; Write a Line-Feed and Carriage-Return to console\r
+    1727/     FA3 :                     ;\r
+    1728/     FA3 : 3E 0D               CRLF:  MVI     A,0Dh           ; Carriage return\r
+    1729/     FA5 : CD AA 0F                   CALL    OUT             ; Output\r
+    1730/     FA8 : 3E 0A                      MVI     A,0Ah           ; Line-feed\r
+    1731/     FAA :                     ;\r
+    1732/     FAA :                     ; User supplied I/O routines.\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 32 - 1/25/2012 21:31:36\r
+\r
+\r
+    1733/     FAA :                     ;-----------------------------------------------------------\r
+    1734/     FAA :                     ; NOTE: "OUT" must appear first because "CRLF" falls into it.\r
+    1735/     FAA :                     ;\r
+    1736/     FAA :                     ; Write character in A to console (8251 uart)\r
+    1737/     FAA : F5                  OUT:   PUSH    PSW             ; Save char\r
+    1738/     FAB : DB 09               OUT1:  IN      9               ; Get 8251 status\r
+    1739/     FAD : 0F                         RRC                     ; Test TX bit\r
+    1740/     FAE : D2 AB 0F                   JNC     OUT1            ; Not ready\r
+    1741/     FB1 : F1                         POP     PSW             ; Restore char\r
+    1742/     FB2 : D3 08                      OUT     8               ; Write 8251 data\r
+    1743/     FB4 : C9                         RET\r
+    1744/     FB5 :                     ; Check for a character from the console (8251 uart)\r
+    1745/     FB5 : DB 09               IN:    IN      9               ; Get 8251 status\r
+    1746/     FB7 : E6 02                      ANI     00000010b       ; Test for ready\r
+    1747/     FB9 : C8                         RZ                      ; No char\r
+    1748/     FBA : DB 08                      IN      8               ; Get 8251 data\r
+    1749/     FBC : C9                         RET\r
+    1750/     FBD :                     ;\r
+    1751/     FBD :                     ; Initialize the timer & uart\r
+    1752/     FBD :                     ;\r
+    1753/     FBD :                     ; 8251A initialisation, according to datasheet (3x 00h + RESET 040h)  \r
+    1754/     FBD : AF                  INIT:  XRA     A               ; Insure not setup mode\r
+    1755/     FBE : D3 09                      OUT     9               ; Write once\r
+    1756/     FC0 : D3 09                      OUT     9               ; Write again (now in operate mode)\r
+    1757/     FC2 : D3 09                      OUT     9               ; Write again (now in operate mode)\r
+    1758/     FC4 : 3E 40                      MVI     A,01000000b     ; Reset\r
+    1759/     FC6 : D3 09                      OUT     9               ; write it\r
+    1760/     FC8 : 3E 4E                      MVI     A,01001110b     ; 8 data, 1 stop, x16\r
+    1761/     FCA : D3 09                      OUT     9               ; Write it\r
+    1762/     FCC : 3E 15                      MVI     A,00010101b     ; RTS,DTR,Enable RX,TX\r
+    1763/     FCE : D3 09                      OUT     9               ; Write it\r
+    1764/     FD0 :                     ; starts timer in 8155 RIOT chip\r
+    1765/     FD0 :                     ; timer count rate 307200Hz, with divider 15360(3C00H)\r
+    1766/     FD0 :                     ; is the resulting interrupt rate exactly 20Hz\r
+    1767/     FD0 : AF                  I8155: XRA     A               ; counter low 8 bits\r
+    1768/     FD1 : D3 04                      OUT     04h\r
+    1769/     FD3 : 3E 7C                      MVI     A,7Ch           ; counter high 6 bits + mode cont.square -> 0 1\r
+    1770/     FD5 : D3 05                      OUT     05h\r
+    1771/     FD7 : 3E C0                      MVI     A,0C0h          ; 8155 mode, start timer,\r
+    1772/     FD9 : D3 00                      OUT     00h             ; disable port C interrupts, all ports input\r
+    1773/     FDB : C9                         RET\r
+    1774/     FDC :                     \r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 33 - 1/25/2012 21:31:36\r
+\r
+\r
+  symbol table (* = unused):\r
+  ------------------------\r
+\r
+ AFLAG :                       FFB1 C |  AL2 :                          5A4 C |\r
+ AL3 :                          5AE C |  ALOOP :                        582 C |\r
+ ALP1 :                         588 C | *ARCHITECTURE :  i386-unknown-win32 - |\r
+ AUTMSG :                       C9F C |  AUTO :                         4BD C |\r
+ BC :                          FFA6 C | *BIGENDIAN :                      0 - |\r
+*BRANCHEXT :                      0 - |  BRKTAB :                      FFB2 C |\r
+ BUFFER :                      FFD0 C |  CALC :                         7D6 C |\r
+ CALC1 :                        7DE C |  CALC2 :                        7F7 C |\r
+ CALC3 :                        7FE C |  CALC8 :                        7CC C |\r
+ CALRET :                       3F2 C | *CARRY :                        3A9 C |\r
+*CASESENSITIVE :                  0 - |  CBC :                          471 C |\r
+ CDE :                          466 C |  CHG1 :                         449 C |\r
+ CHG2 :                         451 C |  CHKS1 :                        F7F C |\r
+ CHKSUS :                       F67 C |  COMP16 :                       53C C |\r
+*CONSTPI :        3.141592653589793 - |  COPY :                         542 C |\r
+ COPY1 :                        55C C |  COPY2 :                        569 C |\r
+ COPY3 :                        56E C |  CP :                           487 C |\r
+ CPC :                          498 C |  CRLF :                         FA3 C |\r
+ CSP :                          47C C |  CTABLE :                       1BB C |\r
+*DATE :                   1/25/2012 - |  DE :                          FFA4 C |\r
+ DINST :                        8AA C |  DISBRK :                       283 C |\r
+ DISLP :                        288 C |  DISON :                        2E8 C |\r
+ DLBAD :                        683 C |  DLEOF :                        719 C |\r
+ DLERR :                        764 C |  DLINT :                        6EB C |\r
+ DLINT1 :                       708 C | *DLMOT :                        6B1 C |\r
+ DLREC :                        6A4 C |  DLWAIT :                       694 C |\r
+ DLWAIT1 :                      696 C |  DMOT1 :                        6D9 C |\r
+ DRAM :                        FFA0 - |  DSTACK :                         0 - |\r
+ EDIT :                         4D8 C |  EDIT1 :                        4DB C |\r
+ EDIT2 :                        501 C |  EDIT3 :                        50C C |\r
+ ENFLG :                        3BE C |  ENTRY :                         5A C |\r
+ ERROR :                        1AA C |  FAKE :                         438 C |\r
+*FALSE :                          0 - |  FILL :                         51C C |\r
+ FILL1 :                        531 C |  FIXL :                          BA C |\r
+ FOUND :                         9C C | *FULLPMMU :                       1 - |\r
+ GETBYT :                       740 C |  GETCHI :                       7BB C |\r
+ GETCHR :                       7BC C |  GETN1 :                        762 C |\r
+ GETNIB :                       74D C |  GIVLF :                        2AD C |\r
+ GO :                           2FA C |  GODIS :                        5BD C |\r
+ GOJMP :                        3C7 C |  GOSET :                        321 C |\r
+*HAS64 :                          1 - | *HASDSP :                         0 - |\r
+*HASFPU :                         0 - | *HASPMMU :                        0 - |\r
+ HELP :                         1F1 C |  HELP1 :                        1F8 C |\r
+ HELP2 :                        1FA C |  HELP3 :                        20C C |\r
+ HELP4 :                        21E C |  HL :                          FFA2 C |\r
+ HLJMP :                        3FD C |  HLOUT :                        F40 C |\r
+ HLOUT2 :                       895 C |  HOUT :                         F4E C |\r
+ HPR :                          F45 C |  HTEXT :                        CBB C |\r
+*I8155 :                        FD0 C |  IN :                           FB5 C |\r
+ INCHR :                        F38 C | *INEXTMODE :                      0 - |\r
+ INIL1 :                        177 C |  INIT :                         FBD C |\r
+*INLWORDMODE :                    0 - | *INMAXMODE :                      0 - |\r
+ INPT :                         767 C |  INPT1 :                        76A C |\r
+ INPT2 :                        78D C |  INPT3 :                        793 C |\r
+ INPT4 :                        7A8 C |  INPUT :                        229 C |\r
+*INSRCMODE :                      0 - |  INST :                        FFCA C |\r
+*INSUPMODE :                      0 - |  ITABLE :                       9A9 C |\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 34 - 1/25/2012 21:31:36\r
+\r
+\r
+ JNKJK :                        373 C | *LISTON :                         1 - |\r
+ LOAD :                         661 C |  LOAD1 :                        66E C |\r
+ LOAD2 :                        677 C |  LOOK :                         937 C |\r
+ LOOK1 :                        93D C |  LOOK10 :                       99D C |\r
+ LOOK2 :                        945 C |  LOOK3 :                        94E C |\r
+ LOOK4 :                        953 C |  LOOK5 :                        965 C |\r
+ LOOK6 :                        978 C |  LOOK7 :                        984 C |\r
+ LOOK8 :                        98A C |  LOOK9 :                        990 C |\r
+ LOOK9A :                       99C C | *MACEXP :                         1 - |\r
+ MEMRY :                        57B C | *MOMCPU :                      8080 - |\r
+*MOMCPUNAME :                  8080 - | *NESTMAX :                      100 - |\r
+ NOADR :                        30A C |  NOBK :                          B5 C |\r
+ NOCOM :                        39B C |  NOFIX :                         C5 C |\r
+ NOHEX :                        303 C |  NOJNK :                        382 C |\r
+ NOPCHL :                       356 C |  NOPSH :                        3EC C |\r
+ NORES :                        41B C |  NORSTV :                       369 C |\r
+ NOTBRK :                        91 C |  NOTRC :                        40A C |\r
+ NOTSET :                       2A5 C |  OFF :                          C9B C |\r
+ OFLAG :                       FFAE C |  OKCH :                         457 C |\r
+ ON :                           C97 C |  ONOFF :                        4A3 C |\r
+ OUT :                          FAA C |  OUT1 :                         FAB C |\r
+ OUTB :                         8A0 C |  OUTP :                         F94 C |\r
+ OUTP1 :                        F9E C |  OUTPT :                        888 C |\r
+ OUTPUT :                       248 C | *PACKING :                        0 - |\r
+*PADDING :                        1 - |  PADR :                         3D6 C |\r
+ PARITY :                       3BB C |  PC :                          FFAC C |\r
+ PCHR :                         8E5 C |  PRTMSG :                       F58 C |\r
+ PRTSTR :                       F5D C |  PSW :                         FFA8 C |\r
+ RECR :                         18A C |  REGDIS :                       813 C |\r
+ REGIST :                       440 C | *RELAXED :                        0 - |\r
+ RESBP :                        40F C |  REST :                         18D C |\r
+ REST1 :                        19E C |  REST2 :                        1B2 C |\r
+ RETON :                        4BB C |  ROM :                            0 - |\r
+ RPTAB :                         56 C | *RST1 :                           8 C |\r
+*RST15 :                          C C | *RST2 :                          10 C |\r
+*RST25 :                         14 C | *RST3 :                          18 C |\r
+*RST35 :                         1C C | *RST4 :                          20 C |\r
+*RST5 :                          28 C | *RST55 :                         2C C |\r
+*RST6 :                          30 C | *RST65 :                         34 C |\r
+*RST7 :                          38 C | *RST75 :                         3C C |\r
+*RST8 :                          40 C |  RSTINT :                        44 C |\r
+ RTAB :                          4E C |  SBRLP :                        26F C |\r
+ SETBRK :                       25E C |  SETOF1 :                       728 C |\r
+ SETOFF :                       71B C |  SFLAG :                       FFB0 C |\r
+ SHXRC :                        62F C |  SHXRC1 :                       64B C |\r
+ SIGN :                         3AF C |  SKIP :                         7B0 C |\r
+ SNDHEX :                       5ED C |  SNDHX1 :                       603 C |\r
+ SNDHX2 :                       615 C |  SNDHX3 :                       61B C |\r
+ SP :                          FFAA C |  SPACE :                        89B C |\r
+ SPLP :                         8EF C |  SUBMSG :                       CA8 C |\r
+ SUBON :                        4C6 C |  T1 :                           927 C |\r
+*T2 :                           917 C |  T3 :                           929 C |\r
+ TEST :                         10B C |  TFLAG :                       FFAF C |\r
+*TIME :                    21:31:36 - |  TOCAP :                        7C0 C |\r
+ TOCAP1 :                       7C7 C |  TRACE :                        4CF C |\r
+*TRAP :                          24 C |  TRCMSG :                       CB3 C |\r
+ TRL :                           F3 C |  TRTB :                          DB C |\r
+*TRUE :                           1 - |  TRYBRK :                        85 C |\r
+ UBASE :                       FFA0 C |  USRB1 :                        5E4 C |\r
+ USRBASE :                      5CF C |  VALHEX :                       805 C |\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 35 - 1/25/2012 21:31:36\r
+\r
+\r
+*VERSION :                     142F - |  VLOOP :                        5C6 C |\r
+ VLP1 :                         8C1 C |  VLP2 :                         8CE C |\r
+ VLP3 :                         8F8 C |  VOUT :                         907 C |\r
+ VOUT1 :                        911 C |  ZERO :                         3B5 C |\r
+\r
+    242 symbols\r
+     47 unused symbols\r
+\r
+\f AS V1.42 Beta [Bld 72] - source file mon85-v12-ncb85.asm - page 36 - 1/25/2012 21:31:36\r
+\r
+\r
+  codepages:\r
+  ----------\r
+\r
+STANDARD (0 changed characters)\r
+\r
+\r
+0.02 seconds assembly time\r
+\r
+   1774 lines source file\r
+      2 passes\r
+      0 errors\r
+      0 warnings\r
diff --git a/software/mon85/mon85-v12.txt b/software/mon85/mon85-v12.txt
new file mode 100644 (file)
index 0000000..69eadfe
--- /dev/null
@@ -0,0 +1,33 @@
+-------------------------------------------------------------------------------\r
+\r
+MON85: A software debugger for the 8080/8085 processor\r
+\r
+Copyright 1979-2007 Dave Dunfield\r
+All rights reserved.\r
+\r
+-------------------------------------------------------------------------------\r
+\r
+Version 1.2 - 2012 Roman Borik\r
+\r
+New in version 1.2\r
+ - Support for undocumented 8085 instructions.\r
+   DSUB B, ARHL, RDEL, LDHI s8, LDSI s8, LHLX D, SHLX D, JNK a16, JK a16, RSTV\r
+ - Command R displays all flags of F register (SZKA3PVC). If flag is not set\r
+   dash '-' is displayed.\r
+ - Added restart vector RST 8 (0040h) for possibility to handle RSTV jump.\r
+ - Changed TRACE mode. After entering TRACE mode, instruction on actual PC and\r
+   content of registers (if it is switched on) are displayed.\r
+   Entering a space ' ' executes this instruction, and returns to the 'T>'\r
+   prompt with the next instruction.\r
+ - Instructions LXI, DAD, INX, DCX displays argument 'SP' rather than 'S'.\r
+ - Commands that requires 1 byte parameter raises error if entered value\r
+   not fit to 1 byte.\r
+ - Command 'C' checks overlap of source and destination block and for copying\r
+   uses appropriate direction.\r
+ - Command 'F' checks <start> and <end> parameters and raises error,\r
+   if <end> is lower than <start>.\r
+ - Added command 'H' to send out memory content in Intel HEX format.\r
+ - Sending of LF and CR characters were reversed and are sent in the usual\r
+   order - CR first and followed by LF.\r
+\r
+-------------------------------------------------------------------------------\r
diff --git a/software/mon85/mon85.txt b/software/mon85/mon85.txt
new file mode 100644 (file)
index 0000000..918bc28
--- /dev/null
@@ -0,0 +1,368 @@
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+                                     MON85\r
+\r
+                                       A\r
+                             Software Debug Monitor\r
+\r
+                               For the 8085/8080\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+                          Dunfield Development Systems\r
+                          ----------------------------\r
+                             High quality tools for\r
+                              Embedded Development\r
+                                 at low prices.\r
+\r
+                            http://www.dunfield.com\r
+\r
+\r
+                       Copyright 1979-2007 Dave Dunfield\r
+                              All rights reserved\r
+\f\r
+\r
+\r
+                                     MON85\r
+\r
+                               TABLE OF CONTENTS\r
+\r
+\r
+                                                                         Page\r
+\r
+     1. INTRODUCTION                                                        1\r
+\r
+        1.1 8085 Restart Interrupts                                         1\r
+        1.2 Breakpoints                                                     2\r
+\r
+     2. MON85 COMMANDS                                                      3\r
+\r
+        2.1 A ON|OFF                                                        3\r
+        2.2 B [0-7 address]                                                 3\r
+        2.3 C <source> <destination> <size>                                 3\r
+        2.4 D <address>                                                     3\r
+        2.5 E <address>                                                     3\r
+        2.6 F <start> <end> <value>                                         4\r
+        2.7 G [address]                                                     4\r
+        2.8 I <port>                                                        4\r
+        2.9 L [address]                                                     4\r
+        2.10 M <address>                                                    4\r
+        2.11 O <port> <data>                                                4\r
+        2.12 R [rp value]                                                   4\r
+        2.13 S ON|OFF                                                       5\r
+        2.14 T ON|OFF                                                       5\r
+        2.15 U [address]                                                    5\r
+        2.16 ?                                                              5\r
+\r
+     3. COMMAND SUMMARY                                                     6\r
+\r
+\f    MON85                                                            Page: 1\r
+\r
+\r
+    1. INTRODUCTION\r
+\r
+          MON85 is a ROMable interactive  debugging  program  for  the  8085\r
+       processor,  which contains a full complement of commands  to  monitor\r
+       and control the execution of your program.  It may also be used on an\r
+       8080 processor,  as long as you  do  not  attempt  to  use  the  8085\r
+       specific SIM  and  RIM  instructions,  or  the  '.5'  type  interrupt\r
+       vectors.\r
+\r
+          MON85 must be installed beginning at location $0000  in  the  8085\r
+       processor memory map, allowing it to intercept the interrupt vectors.\r
+       Provision has been made to re-vector interrupts to  locations  within\r
+       the user program.\r
+\r
+          All functions of MON85 are performed via software without hardware\r
+       assist.  The only  hardware  specific  subroutines  required  by  the\r
+       monitor are used to communicate with the console  terminal,  and  are\r
+       located at the very end of the monitor source code listing:\r
+\r
+        INIT    - Called to initialize any hardware required for I/O.\r
+\r
+        OUT     - Write the character in A to the console. No processor\r
+                  registers should be modified by this routine.\r
+\r
+        IN      - Test for a character from the console, and return it\r
+                  in A if one is available. Otherwise clear A to zero.\r
+                  No other registers should be modified by this routine.\r
+\r
+       1.1 8085 Restart Interrupts\r
+\r
+             MON85 reserves two "restart" interrupts:  RST 0 is similar to a\r
+          physical RESET,  causes  a  cold  restart  of  the  monitor.  This\r
+          instruction should be used with CAUTION during a debugging session\r
+          because  any  breakpoints  set  in  the  user  program   will   be\r
+          "forgotten",  and not properly removed.  RST 1 is used by MON85 to\r
+          regain   control   at   breakpoints.   Opcodes   of   breakpointed\r
+          instructions are replaced by RST 1 whenever the  user  program  is\r
+          executed,  and are restored whenever the  monitor  is  re-entered.\r
+          This insures that the operation of breakpoints is  transparent  to\r
+          you during the debugging session.\r
+\r
+             If for any reason a 'RST 1' ($CF) instruction is encountered in\r
+          the user program  (and is not a breakpoint),  command mode will be\r
+          entered without the '** Breakpoint' message.\r
+\r
+             All  other  "restart"  interrupts  are   re-vectored   to   the\r
+          corresponding locations in the first page of  memory  occupied  by\r
+          the user program (as identified by the 'U' command).\r
+\f    MON85                                                            Page: 2\r
+\r
+\r
+       1.2 Breakpoints\r
+\r
+             MON85 allows you to set breakpoints in your program,  such that\r
+          you  will  be  given  control  whenever  the  program  reaches   a\r
+          breakpoint,  and can examine or change things  before  proceeding.\r
+          MON85 also allows you to TRACE a program, so that you can see each\r
+          instruction and register contents as it executes.\r
+\r
+             MON85 is completely transparent to  the  program  being  tested\r
+          (unless timing loops are interrupted with BREAKPOINTS  or  TRACE).\r
+          When a breakpoint is encountered,  or an  instruction  is  traced,\r
+          MON85 uses one stack entry on the user program stack.  Since  this\r
+          consists of a PUSH and a POP, it should not affect any information\r
+          stacked by the user program. However, you should be aware of this,\r
+          in case you are examining the  stack,  or  your  program  trys  to\r
+          reclaim data already popped from  the  stack.  (It  is  very  poor\r
+          practice,  to write programs which depend on  the  stack  contents\r
+          below the stack pointer).\r
+\r
+             When a breakpoint is encountered, the message '** Breakpoint n'\r
+          is printed where n is the number of the breakpoint (0-7). If TRACE\r
+          is ON, no other action is taken, otherwise command mode is entered\r
+          (If the  'A'  switch  (see below)  is ON the  registers  are  also\r
+          displayed).\r
+\f    MON85                                                            Page: 3\r
+\r
+\r
+    2. MON85 COMMANDS\r
+\r
+          The following commands are recognized by MON85, and may be entered\r
+       whenever MON85 is in COMMAND MODE,  which is indicated by the  'C>  '\r
+       prompt:\r
+\r
+       2.1 A ON|OFF\r
+\r
+          This switch turns ON or OFF the automatic register  display  which\r
+          occurs whenever a breakpoint is encountered or an  instruction  is\r
+          stepped in trace mode  (see below).  The default value for 'A'  is\r
+          ON.\r
+\r
+       2.2 B [0-7 address]\r
+\r
+          Sets one of eight breakpoints [0-7] at the specified address. Once\r
+          set, a breakpoint remains in effect until it is removed by setting\r
+          it to address ZERO (0).  Breakpoints are completely invisible, and\r
+          may be added,  removed or changed  at  any  time  without  adverse\r
+          affects.  If the  'B'  command is issued  with  no  operands,  the\r
+          current breakpoints,  and the settings of the  'A',  'S'  and  'T'\r
+          flags  (see below)  are displayed.  A displayed address of  '****'\r
+          indicates that a breakpoint is not set.\r
+\r
+       2.3 C <source> <destination> <size>\r
+\r
+          Copies  <size>  bytes  of  memory  from  the   <source>   to   the\r
+          <destination> address.\r
+\r
+       2.4 D <address>\r
+\r
+          Displays memory in assembly listing format, starting at <address>,\r
+          continuing until an ESCAPE character is  entered.  Output  can  be\r
+          temporarily stopped with the SPACE BAR,  and  restarted  with  the\r
+          RETURN key  (Additional SPACE's will  output  single  lines).  The\r
+          output is displayed in the following form:\r
+\r
+                  '<address> <opcodes> <ascii> <instruction>'\r
+\r
+          <address>  is  the  current  memory  location,  <opcodes>  is  the\r
+          instruction  opcodes  (1,  2  or  3  bytes),  <ascii>   is   ASCII\r
+          representation of  <opcodes>  (all  non-printable  characters  are\r
+          displayed as dots),  and  <instruction>  is the assembly  language\r
+          instruction and operands which <opcodes> represents.\r
+\r
+       2.5 E <address>\r
+\r
+          Edits memory, starting at <address>. The address, and its contents\r
+          are displayed, followed by a '=' prompt. Sub commands are:\r
+\r
+            nn [nn ...] - Replace memory contents with HEX data bytes\r
+            'text ...   - Replace memory contents with ASCII text\r
+            -           - Backup to previous locations\r
+            <blank line>- Advance to next location with change\r
+            <ESCAPE>    - Return to MON85 command prompt\r
+\f    MON85                                                            Page: 4\r
+\r
+\r
+       2.6 F <start> <end> <value>\r
+\r
+          Fills memory between the  <start>  and  <end>  addressses with the\r
+          specified <value>.\r
+\r
+       2.7 G [address]\r
+\r
+          Loads the user program registers,  and  begins  execution  at  the\r
+          specified address.  If no [address] is given,  execution begins at\r
+          the address contained in the user program program counter (PC).  A\r
+          simple  'G'  with no operands,  is all that is  needed  to  resume\r
+          execution after a breakpoint interrupt,  or to resume  trace  mode\r
+          exection.\r
+\r
+       2.8 I <port>\r
+\r
+          Reads the specified 8085 I/O port, and displays the data.\r
+\r
+       2.9 L [address]\r
+\r
+          Downloads code from the console port.  MON85  will  recognize  and\r
+          accept either INTEL or MOTOROLA hex format download  records.  The\r
+          address in the FIRST download record is recorded  as  the  program\r
+          BASE address  (See 'U' command).  If an  [address]  is given,  the\r
+          address fields of each record are adjusted so that the code  image\r
+          will be loaded into memory beginning at that address, otherwise it\r
+          is placed in memory at the  absolute  address  contained  in  each\r
+          record.\r
+\r
+          If you accidently enter this command, you may enter either 'S9' or\r
+          ':00'  to signify a null download file and return to  the  command\r
+          prompt.\r
+\r
+       2.10 M <address>\r
+\r
+          Displays memory in HEX/ASCII dump format starting at the specified\r
+          address. ESCAPE, SPACE, and CARRIAGE-RETURN can be used to control\r
+          the listing, the same is with the 'D' command.\r
+\r
+       2.11 O <port> <data>\r
+\r
+          This command writes the  <data>  byte to the  specified  8085  I/O\r
+          <port>.\r
+\r
+       2.12 R [rp value]\r
+\r
+          Changes the contents of the user program register pair <rp> to the\r
+          specified <value>. Valid pairs are BC, DE, HL, SP, PC, and PSW. If\r
+          no operands are given,  the contents of the user program registers\r
+          are displayed.\r
+\f    MON85                                                            Page: 5\r
+\r
+\r
+       2.13 S ON|OFF\r
+\r
+          Controls the handling of subroutine calls when in trace mode  (see\r
+          below).  When 'S' is set ON,  subroutines will be be traced in the\r
+          normal fashion.  When set OFF,  subroutines calls are not  traced,\r
+          and trace will resume at the next instruction following  the  CALL\r
+          (After the subroutine executes).\r
+\r
+          WARNING: DO NOT SET BREAKPOINTS IN THE SUBROUTINES WHEN 'S' IS SET\r
+          OFF.  When 'S' is set off, MON85 considers the subroutine (and all\r
+          of it's embedded instructions)  to be one single operation.  If  a\r
+          breakpoint is encountered inside the subroutine,  TRACE will  lose\r
+          the address at which to resume following the subroutine call. This\r
+          will cause  unpredictable  action  when  the  subroutine  returns.\r
+          Otherwise,  'S'  may be turned on and off  at  any  time  with  no\r
+          adverse effects. The default value for 'S' is ON.\r
+\r
+       2.14 T ON|OFF\r
+\r
+          Turns TRACE mode ON and OFF.  When TRACE is set  ON,  and  the  GO\r
+          command is issued,  MON85  will  first  prompt  with  'T>'  before\r
+          beginning program execution.\r
+\r
+          Entering a space  (' ')  will display and execute one instruction,\r
+          and return to the 'T>' prompt.\r
+\r
+          Entering  '?'  will display the processor registers.  (If the  'A'\r
+          switch is set ON,  they will always be displayed  following  every\r
+          instruction that is traced).\r
+\r
+          An ESCAPE charecter will  cause  MON85  to  return  to  the  usual\r
+          command prompt  (TRACE remains ON,  and will resume with the  next\r
+          'G' command).\r
+\r
+          Trace may be turned on and off at any time in a program,  with  no\r
+          adverse effects.  (If you begin execution with TRACE off, you will\r
+          have to hit a breakpoint to get you back to  command  mode  before\r
+          you can turn TRACE on).\r
+\r
+          When a breakpointed instruction is encountered by the tracer,  The\r
+          message  '** Breakpoint n'  will be  issued  at  the  end  of  the\r
+          previous instruction, indicating that the breakpointed instruction\r
+          occurs NEXT.  Pressing  the  SPACE  BAR  would  then  execute  the\r
+          breakpointed instruction. The default value for 'T' is OFF.\r
+\r
+       2.15 U [address]\r
+\r
+          Identifies the starting address of a user program. MON85 uses this\r
+          address to re-map the "restart"  interrupt vectors.  When a 'L'oad\r
+          command  is  performed,  MON85  initializes  'U'  to  the  address\r
+          contained in  the  first  download  record.  If  no  [address]  is\r
+          specified,  MON85 will display the current user  program  starting\r
+          address.\r
+\r
+       2.16 ?\r
+\r
+          This command displays a short summary of the other MON85 commnds.\r
+\f    MON85                                                            Page: 6\r
+\r
+\r
+    3. COMMAND SUMMARY\r
+\r
+        A ON/OFF                - Enables/Disables auto register display.\r
+\r
+        B [0-7 address]         - Sets/Removes/Displays breakpoints.\r
+\r
+        C <src> <dest> <size>   - Copy memory\r
+\r
+        D <address>             - Displays memory in disassembly format.\r
+\r
+        E <address>             - Edit memory contents.\r
+\r
+        F <start> <end> <value> - Fill memory with a value.\r
+\r
+        G [address]             - Begin/Resume program execution.\r
+\r
+        I <port>                - Input from port\r
+\r
+        L [address]             - Download from host\r
+\r
+        M <address>             - Displays memory in dump format.\r
+\r
+        O <port> <data>         - Output to port\r
+\r
+        R [rp value]            - Sets/Displays register contents.\r
+\r
+        S ON|OFF                - Enables/Disables subroutine traceing.\r
+\r
+        T ON|OFF                - Enables/Disables TRACE mode.\r
+\r
+        U [address]             - Set/Displays program base address.\r
+\r
+        ?                       - Display command summary\r