home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / asm / MISC_ASM.ZIP / BEEP01.ASM next >
Encoding:
Assembly Source File  |  1987-02-26  |  1.8 KB  |  67 lines

  1.     page    ,132
  2.     title    Batch file Beep
  3.  
  4. ;------------------------------------------------------------------------
  5. ;
  6. ;  Beep      -    Bill Gibson - 1987
  7. ;        Lathrup Village, Mi 48076
  8. ;
  9. ; * Ver. 1.01 -  sound using ASCII character 7            -    02/26/87
  10. ;     1.02 -  using the 8253 timer chip directly        -    02/26/87
  11. ;
  12. ;  For Public Domain Use.  Not for Sale or Hire.
  13. ;------------------------------------------------------------------------
  14. COMMENT *
  15.        As requested by Viggo Jensen.
  16.  
  17.    Beep utility - sounds alarm until any key is pressed.
  18.  
  19.           Obviously, best use of this small utility is at
  20.           the end of a batch file.  Could be used to replace
  21.           the DOS "pause" command.
  22. *
  23. ;------------------------------------------------------------------------
  24. code        SEGMENT BYTE PUBLIC 'code'
  25. ASSUME        CS:code,DS:code,SS:code
  26.  
  27.         ORG    100h
  28.  
  29. Beep        PROC    FAR
  30.  
  31.         CALL    Sound        ;beep the horn
  32. exit:
  33.         MOV    AH,4Ch
  34.         INT    21h
  35.  
  36. ;------------------------------------------------------------------------
  37. ; Work Area - constants,equates,messages
  38. ;------------------------------------------------------------------------
  39. cr        EQU    0Dh        ;carriage return
  40. lf        EQU    0Ah        ;line feed
  41. esc        EQU    01Bh        ;escape char
  42.  
  43. msg1        DB    cr,lf,'Beeping - press any key to quit...','$'
  44.  
  45. ;--------------------------------------------------------------------------
  46. ; Sub-Routines: Declare each Proc PUBLIC for use with MapSym & SymDeb v4.0
  47. ;--------------------------------------------------------------------------
  48.         PUBLIC    Sound
  49. Sound        PROC    NEAR
  50.         MOV    DX,OFFSET msg1
  51.         MOV    AH,9
  52.         INT    21h
  53. s1:
  54.         MOV    DL,7        ;sound the horn
  55.         MOV    AH,2
  56.         INT    21h
  57.         MOV    AH,0Bh        ;check standard input device
  58.         INT    21h
  59.         OR    AL,AL        ;any character waiting ?
  60.         JZ    s1
  61.         RET
  62. Sound        ENDP
  63.  
  64. Beep        ENDP
  65. code        ENDS
  66.         END    Beep
  67.