Category : C Source Code
Archive   : WIND.ZIP
Filename : W_BEEP.ASM
; uses MASM 5.0
IFDEF LATTICE
; here's what Lattice uses -- if you're assembling for Lattice C, use
; masm /Dlattice w_beep;
DGROUP GROUP DATA
DATA SEGMENT WORD PUBLIC 'DATA'
ASSUME DS:DGROUP,ES:DGROUP,SS:DGROUP
DATA ENDS
PGROUP GROUP PROG
PROG SEGMENT BYTE PUBLIC 'PROG'
ASSUME CS:PGROUP
_beep equ
ELSE
; this works for Microsoft or Turbo C -- assemble with the command:
; masm /MX w_beep;
.model small
.code
ENDIF
public _beep
_beep proc
in al,61h ; save old speaker setting
push ax
mov al,0 ; set speaker frequency
out 42h,al ; low byte
mov al,5 ; lower this number for higher frequency
out 42h,al ; high byte
pop ax ; old speaker setting
push ax ; save again
or al,3 ; turn on speaker
out 61h,al
mov cx,03000h
waitloop:
loop waitloop
pop ax ; turn off speaker
out 61h,al
ret
_beep endp
IFDEF LATTICE
PROG ENDS
ENDIF
end
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/