; PAUSE.ASM - Breakpoint for Submit files ; Mark Anaker 08/18/83 ; From Byte magazine listing in the March 1985 issue . ; Modified by Merlin R. Null, 5/23/85. ; Added BEGIN and DONE to return to CP/M without ; warm boot when aborting. For CP/M 2.2 only. ; ;---------------------------------------------------------------- ; ; Define CP/M Routines ; RCONF EQU 1 ; read CON: into (A) WCONF EQU 2 ; write (A) to CON: DRIVE EQU 4 ; check current drive number BDOS EQU 5 ; system call entry CSTAF EQU 11 ; check CON: status DELFIL EQU 19 ; delete file ; ; Misc. Equates ; BOOT EQU 0 FCB EQU 005CH ; default file control block BEL EQU 7 ; bell LF EQU 10 ; line feed CR EQU 13 ; carriage return ; ORG 0100H ; load at start of TPA ; ; Set Up Stack ; BEGIN: LXI H,0 ; save CP/M stack DAD SP SHLD CPMSP LXI SP,STAK ; set up local stack LDA DRIVE ; save current disk STA DRSAV MVI C,CSTAF ; check console status CALL BDOS ; for any input ORA A JZ START ; if none, run the program MVI C,RCONF ; read and ignore CON: CALL BDOS ; (debounce keys) JMP START ; run the program ; ; COMMON SUBROUTINES ; ; Message Pointed to by Stack out to Console ; SPMSG: XTHL ; get "return address" to HL PUSH B ; save BC PUSH D ; save DE ; SPMSG1: MOV A,M ; get one message character ORA A ; check for zero INX H ; point to next JZ SPMSG2 ; exit if done MVI C,WCONF ; select write to CON: MOV E,A ; character to E PUSH H ; save HL CALL BDOS ; output to CP/M POP H ; restore HL JMP SPMSG1 ; get another ; SPMSG2: POP D ; restore DE POP B ; restore BC XTHL ; restore stack for RET ; "return" when done ; ; ; End of Program Execution ; DONE: LDA DRSAV ; restore "current" disk STA DRIVE LHLD CPMSP ; restore CP/M stack SPHL RET ; return to CP/M ; ; Main Program Area ; START: CALL SPMSG ; message to console DB CR,LF,BEL,'Press A to abort, any other' DB ' to continue ',0 MVI C,RCONF ; get char from console CALL BDOS ; let BDOS do it ANI 5FH ; mask to upper case CPI 'A' ; is it A? JZ KILLIT ; if yes go to KILLIT CALL SPMSG ; message out to console DB CR,LF,'Continuing with Submit',CR,LF,0 JMP BOOT ; exit to warm boot ; ; Kill $$$.SUB, per Console Request ; KILLIT: LXI D,SUBFCB ; point to filename MVI C,DELFIL ; DELETE FILE function CALL BDOS ; let BDOS do it CALL SPMSG ; message to console DB CR,LF,'Submit processing aborted!',CR,LF,0 JMP DONE ; exit to CP/M ; ; Data Area ; SUBFCB: DB 1 ; drive A: DB '$$$ SUB' ; SUBMIT processor file DS 24 ; the rest of the FCB ; ; Define Space ; DRSAV: DB 0 ; Current Drive Number CPMSP: DW 0 ; CP/M stack pointer ; ; DS 20H ; reserve stack of 32 bytes STAK: ; END