home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / batch.lbr / WAIT.AQM / WAIT.ASM
Encoding:
Assembly Source File  |  1993-03-31  |  2.8 KB  |  93 lines

  1. ;
  2. ; WAIT.ASM    Version 1.0    May 26, 1987
  3. ;
  4. ; Note:  This program requires CP/M Plus (CP/M 3.0) and a Z80 CPU.
  5. ;
  6. ; USAGE:    WAIT
  7. ;
  8. ; No command line parameters are needed or accepted.
  9. ;
  10. ; WAIT rings the terminal bell and pauses, waiting for a key to
  11. ; be pressed on the console.  A ^C will cause a failure code to
  12. ; be sent to BDOS.  Any other key (except ^S, ^Q, ^P, see below)
  13. ; will cause WAIT to exit normally.
  14. ;
  15. ; The purpose of this program is to allow pauses during the
  16. ; execution of SUBMIT's and multiple command lines, optionally
  17. ; controlling the execution of conditional commands under CP/M
  18. ; Plus.
  19. ;
  20. ; In a SUBMIT (.SUB) file or in a multiple command line, a command
  21. ; that has a colon as the first character is ignored if the
  22. ; previous command returns a "failure" code; otherwise it is
  23. ; executed normally.  Thus, if you press ^C in answer to WAIT's
  24. ; prompt, any conditional command immediately following WAIT
  25. ; will not be executed.
  26. ;
  27. ; The three control keys intercepted by the BDOS (^S, ^Q, and ^P)
  28. ; will not be passed to WAIT, so other keys will have to be used.
  29. ; However, pressing ^P will cause printer echo to be toggled on
  30. ; or off, so WAIT can also be used merely to be able to start or
  31. ; stop printer echo, if you wish.  To do that you must first
  32. ; press ^S, then ^P, and finally ^Q.  After finishing that
  33. ; sequence, you still have to press another key before WAIT
  34. ; will continue.
  35. ;
  36. ;    Gene Pizzetta            CompuServe:  72060,505
  37. ;    481 Revere Street        QuantumLink:  GeneP
  38. ;    Revere, MA  02151        FOG #29:  (617) 288-4667
  39. ;    Voice: (617) 284-0891
  40. ;
  41. ; Assemble with MAC and load with HEXCOM.  Z80.LIB required.
  42. ;
  43. ;
  44. Bdos    equ    05h        ; BDOS entry
  45. WBoot    equ    00h        ; warm boot
  46. TPA    equ    0100h        ; program load address
  47. Fail    equ    0FF00h        ; program failure code
  48. ;
  49. ; BDOS service functions
  50. ;
  51. ConIn    equ    1
  52. PrtStr    equ    9
  53. BdosRet    equ    108
  54. ;
  55. BELL    equ    07h        ; bell
  56. TAB    equ    09h        ; tab
  57. LF    equ    0Ah        ; linefeed
  58. CR    equ    0Dh        ; carriage return
  59. ;
  60.     MACLIB    Z80
  61. ;
  62.     org    TPA
  63.     jmp    MAIN
  64. ;
  65. Msg1:    db    BELL,CR,LF,'WAIT  1.0  for CPM Plus'
  66.     db    CR,LF,LF,TAB,BELL,'^C  to  Ignore  Next  Conditional'
  67.     db    CR,LF,LF,TAB,'Any  Other  Key  to  Continue  $'
  68. Msg2:    db    CR,LF,LF,'Executing Conditional ...$'
  69. Msg3:    db    CR,LF,LF,'Ignoring Conditional ...$'
  70. ;
  71. MAIN    lxi    d,Msg1        ; print signon
  72.     mvi    c,PrtStr
  73.     call    Bdos
  74.     mvi    c,ConIn        ; get character
  75.     call    Bdos
  76.     cpi    03h        ; control-C ?
  77.     jrz    ABORT        ; (yes, send failure code)
  78.     lxi    d,Msg2        ; print 'continuing'
  79.     mvi    c,PrtStr
  80.     call    Bdos
  81.     jr    EXIT        ; ..and exit
  82. ;
  83. ABORT:    lxi    d,Msg3        ; print 'ignoring'
  84.     mvi    c,PrtStr
  85.     call    Bdos
  86.     lxi    d,Fail        ; send 'failure' code
  87.     mvi    c,BdosRet
  88.     call    Bdos
  89. ;
  90. EXIT    jmp    WBoot        ; warm boot
  91. ;
  92.     end
  93.