home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
USCX
/
ASMUT-03.ZIP
/
BEEP.ASM
< prev
next >
Wrap
Assembly Source File
|
1985-05-11
|
817b
|
49 lines
;SOUND EFFECT GENERATOR
;SQUARE WAVE STYLE
;
STACK SEGMENT PARA STACK 'SATCK'
DB 256 DUP (0)
STACK ENDS
;
;
DATA SEGMENT PARA PUBLIC 'DATA'
FREQ DW 300 ; LOWER VALUE TO RAISE FREQ
DURA DW 160 ;INCREASE VALUE INCREASE DURATION
DATA ENDS
;
;
CODE SEGMENT PARA PUBLIC 'CODE'
MK_TONE PROC FAR
ASSUME CS:CODE,SS:STACK
PUSH DS
SUB AX,AX
PUSH AX
ASSUME DS:DATA
MOV AX,DATA
MOV DS,AX
CLI
MOV DX,DURA
IN AL,61H
AND AL,0FEH
AGAIN: OR AL,2
OUT 61H,AL
MOV CX,FREQ
WAIT1: LOOP WAIT1
AND AL,0FDH
OUT 61H,AL
MOV CX,FREQ
WAIT2: LOOP WAIT2
;
;ONE SQUARE WAVE CYCLE NOW COMPLETE
;
DEC DX
JNZ AGAIN
;
;TONE HAS NOW BEEN PRODUCED FOR DESIRED DURATION
;
STI
RET
MK_TONE ENDP
CODE ENDS
END MK_TONE