home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT10 / TSOUND.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-10  |  806 b   |  22 lines

  1. ;       Program TSound ( Chapter 10 )
  2. ;
  3. .model small
  4. EXTRN   sound : far                     ; external subprogram SOUND will be used
  5. .stack
  6. .data
  7. freq    dw      0,988,880,784,699,659,587,523
  8. .code
  9. .startup
  10.     mov     cx,7                    ; number of signals produced    
  11.     
  12. prod:   mov     bx,cx                   ; number of current signal
  13.     shl     bx,1                    ; multiply number by 2 to obtain offset
  14.     mov     di,word ptr freq[bx]    ; get frequency of current signal
  15.     mov     bx,50                   ; duration - 25 hundreths of second
  16.     call    sound                   ; this produces sound
  17.     loop    prod                    ; next signal
  18.     
  19.     mov     ax,4C00h                ; function 4C - terminate process
  20.     int     21h                     ; DOS service call
  21.     end     
  22.