home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
pascal
/
library
/
dos
/
asm_sour
/
reply.asm
< prev
next >
Wrap
Assembly Source File
|
1984-05-29
|
2KB
|
42 lines
TITLE SNDCLR : CALLER (SOUND.ASM)
PAGE,132
NAME MAIN_AEM
;
;HERE IS THE CODE FOR THE CALLING PROGRAM
;
CSEG SEGMENT PARA PUBLIC 'CODE'
BEEP PROC FAR
ASSUME CS:CSEG
;FIXUP THE STACK TO RETURN TO DOS OR DEBUG
;
begin:
push ds
sub ax,ax
push ax
mov ax,cseg ;get the return program return segment
mov ds,ax
MOV BX,05 ;duration in hundredths of seconds
MOV DI,3580 ;frequency to sound
MOV AL,0B6H ;WRITE TIMER MODE REGISTER
OUT 43H,AL ;LOAD THE PORT
MOV DX,14H
MOV AX,4F38H ;1331000/FREQUENCY PULSE
DIV DI
OUT 42H,AL ;WRITE TIMER LOW BYTE
MOV AL,AH
OUT 42H,AL
IN AL,61H ;GET CURRENT PORT B SETTING
MOV AH,AL ;AND MOVE IT TO AH
OR AL,3 ;SWITCH SPEAKER ON
OUT 61H,AL
WAIT: MOV CX,2801 ;WAIT 10 MILLISECONDS
SPK_ON: LOOP SPK_ON
DEC BX ;SPEAKER ON TIME EXPIRED?
JNZ WAIT ;IF NOT KEEP SPEAKER ON
MOV AL,AH
OUT 61H,AL ;PORT VALUE RECOVERED..CONTINUE
RET
beep endp
CSEG ENDS
END begin