home *** CD-ROM | disk | FTP | other *** search
- ;
- ; WAIT.ASM Version 1.0 May 26, 1987
- ;
- ; Note: This program requires CP/M Plus (CP/M 3.0) and a Z80 CPU.
- ;
- ; USAGE: WAIT
- ;
- ; No command line parameters are needed or accepted.
- ;
- ; WAIT rings the terminal bell and pauses, waiting for a key to
- ; be pressed on the console. A ^C will cause a failure code to
- ; be sent to BDOS. Any other key (except ^S, ^Q, ^P, see below)
- ; will cause WAIT to exit normally.
- ;
- ; The purpose of this program is to allow pauses during the
- ; execution of SUBMIT's and multiple command lines, optionally
- ; controlling the execution of conditional commands under CP/M
- ; Plus.
- ;
- ; In a SUBMIT (.SUB) file or in a multiple command line, a command
- ; that has a colon as the first character is ignored if the
- ; previous command returns a "failure" code; otherwise it is
- ; executed normally. Thus, if you press ^C in answer to WAIT's
- ; prompt, any conditional command immediately following WAIT
- ; will not be executed.
- ;
- ; The three control keys intercepted by the BDOS (^S, ^Q, and ^P)
- ; will not be passed to WAIT, so other keys will have to be used.
- ; However, pressing ^P will cause printer echo to be toggled on
- ; or off, so WAIT can also be used merely to be able to start or
- ; stop printer echo, if you wish. To do that you must first
- ; press ^S, then ^P, and finally ^Q. After finishing that
- ; sequence, you still have to press another key before WAIT
- ; will continue.
- ;
- ; Gene Pizzetta CompuServe: 72060,505
- ; 481 Revere Street QuantumLink: GeneP
- ; Revere, MA 02151 FOG #29: (617) 288-4667
- ; Voice: (617) 284-0891
- ;
- ; Assemble with MAC and load with HEXCOM. Z80.LIB required.
- ;
- ;
- Bdos equ 05h ; BDOS entry
- WBoot equ 00h ; warm boot
- TPA equ 0100h ; program load address
- Fail equ 0FF00h ; program failure code
- ;
- ; BDOS service functions
- ;
- ConIn equ 1
- PrtStr equ 9
- BdosRet equ 108
- ;
- BELL equ 07h ; bell
- TAB equ 09h ; tab
- LF equ 0Ah ; linefeed
- CR equ 0Dh ; carriage return
- ;
- MACLIB Z80
- ;
- org TPA
- jmp MAIN
- ;
- Msg1: db BELL,CR,LF,'WAIT 1.0 for CPM Plus'
- db CR,LF,LF,TAB,BELL,'^C to Ignore Next Conditional'
- db CR,LF,LF,TAB,'Any Other Key to Continue $'
- Msg2: db CR,LF,LF,'Executing Conditional ...$'
- Msg3: db CR,LF,LF,'Ignoring Conditional ...$'
- ;
- MAIN lxi d,Msg1 ; print signon
- mvi c,PrtStr
- call Bdos
- mvi c,ConIn ; get character
- call Bdos
- cpi 03h ; control-C ?
- jrz ABORT ; (yes, send failure code)
- lxi d,Msg2 ; print 'continuing'
- mvi c,PrtStr
- call Bdos
- jr EXIT ; ..and exit
- ;
- ABORT: lxi d,Msg3 ; print 'ignoring'
- mvi c,PrtStr
- call Bdos
- lxi d,Fail ; send 'failure' code
- mvi c,BdosRet
- call Bdos
- ;
- EXIT jmp WBoot ; warm boot
- ;
- end