home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
batutl
/
batutl2.arc
/
REBEEP.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-04-20
|
1KB
|
66 lines
TITLE REBEEP 9-15-84 [4-16-88]
;Toad Hall Disassembly, tweak
LF EQU 0AH
CR EQU 0DH
;
;INITIAL VALUES : CS:IP 0000:0100
; SS:SP 0000:FFFF
CodeSeg SEGMENT
ASSUME DS:CodeSeg,SS:CodeSeg,CS:CodeSeg,ES:CodeSeg
ORG 100H
REBEEP proc near
mov dx,offset prompt ;'Press any key...'
MOV AH,9 ;display string
INT 21H
ChekLoop:
MOV AH,0BH ;check kbd input status
INT 21H
CMP AL,0FFH ;anything there?
JZ GotUser ; yep, user's back
CALL Beep ;beep
CALL Beep ;beep
SUB CX,CX ;max delay time this loop
Lup120: NOP ;delay a sec
LOOP Lup120
JMP SHORT ChekLoop
GotUser:
MOV AH,7 ;gobble user's keypress
INT 21H
;Just for laughs (and to add some utility), we'll return the user's
;keypress as Errorlevel. (It's in AL right now)
mov ah,4CH ;terminate, Errorlevel 0
int 21H
Rebeep endp
Beep proc near
MOV AL,0B6H
OUT 43H,AL
MOV AX,06A0H
OUT 42H,AL ;freq?
MOV AL,AH
OUT 42H,AL ;freq?
IN AL,61H
MOV AH,AL
OR AL,3
OUT 61H,AL ;sound on
SUB CX,CX ;max delay this loop
Lup162: LOOP Lup162 ;sound on
MOV AL,AH
OUT 61H,AL ;sound off
mov cx,4000H ;delay a bit
Lup18x: nop
loop Lup18x
RET
prompt DB CR,LF,10H,' Press any key to continue ...$'
Beep endp
CodeSeg ENDS
END REBEEP