home *** CD-ROM | disk | FTP | other *** search
/ Boston 2 / boston-2.iso / DOS / HILFEN / MODEM / COMAND28 / URGENT.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-01  |  1KB  |  60 lines

  1. ; ----- Sound an 'urgent' alarm
  2. ;    R.McG; 5/89, Chicago
  3. ; ----------------------------------------------------------------
  4. ; Usages:
  5. ;      N0-N5 ---> Destroyed
  6. ;
  7. ; Requires:
  8. ;      This script does not FCALL any other script
  9. ;
  10. ; WARNING:
  11. ;      Modify this script at your own RISK!    Playing with machine
  12. ;      level OUTPUT instructions may be dangerous to you and yours.
  13. ;
  14. ; This script may be FCALLED
  15. ; ----------------------------------------------------------------
  16. ;    Initialize
  17. ;
  18. n2 = 3025        ; Start freq    (440hz -> 3025)
  19. N3 = 3025/4        ; End freq    (1760hz -> 3025/4)
  20. n4 = 10         ; Step between notes
  21.  
  22. WOPEN 10,10,12,70 (contrast) Exit
  23. ATSAY 10,12 (contrast) " Urgent "
  24. ATSAY 11,12 (contrast) "Alarm"
  25. ATSAY 12,30 (contrast) " Press ESC to exit "
  26. ;
  27. ;    Initialize timer
  28. ;    .. (0b6H -> counter 2,load 1 byte at a time,square wave, binary values)
  29. ;
  30. output 0x43 0xb6    ; port = 43h
  31. output 0x42 N2\256    ; lsb
  32. output 0x42 N2/256    ; msb
  33. ;
  34. ;    Turn on speaker
  35. ;
  36. input n0 0x61        ; Get current value
  37. n1 = n0         ; Save value to restore
  38. n0 = n0|3        ; Turn on speaker
  39. output 0x61 n0        ; Turn speaker on
  40. ;
  41. ;    Now, run the frequency fron N2 (start) to N3 (end)
  42. ;
  43. do
  44. FOR N5 = N2-N4,N3,-N4
  45.     output 0x43 0xb6    ; port = 43h
  46.     output 0x42 N5\256    ; lsb
  47.     output 0x42 N5/256    ; msb
  48.     ENDFOR
  49. until zero -1
  50. ;
  51. ;    Turn speaker off
  52. ;
  53. exit:
  54. output 0x61 n1        ; Restore original value
  55. WCLOSE
  56. if fcalled
  57.    freturn
  58.    endif
  59. exit
  60.