Category : Assembly Language Source Code
Archive   : ASMDRV.ZIP
Filename : TONE.ASM

 
Output of file : TONE.ASM contained in archive : ASMDRV.ZIP
tone proc near ;tone
mov ah,0 ;clear ah
push ax ;save ax
mov al,0b6h ;timer chip control word
out 43h,al ;send to timer
mov dx,0 ;clear dividend (hi)
mov ax,14000 ;frequency
pop cx ;restore key value as divisor
inc cx ;add 1 to prevent div by 0
div cx ;quotient is ax
out 42h,al ;output lo order byte
xchg ah,al ;reverse
out 42h,al ;output hi order byte
in al,61h ;get speaker/timer value
or al,3 ;turn on timer & speaker
out 61h,al ;set timer chip
mov cx,15000 ;value for 50 milliseconds
tone1: loop tone1 ;loop
in al,61h ;get timer chip value
and al,0fch ;turn off speaker & timer
out 61h,al ;set timer chip
ret ;return to caller
tone endp ;end of tone


  3 Responses to “Category : Assembly Language Source Code
Archive   : ASMDRV.ZIP
Filename : TONE.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/