Category : Utilities for DOS and Windows Machines
Archive   : BELL.ZIP
Filename : TONE3.ASM

 
Output of file : TONE3.ASM contained in archive : BELL.ZIP

TITLE BELL 10-16-86 [7-6-89]

.RADIX 16

code SEGMENT
ASSUME DS:nothing, SS:nothing, CS:code, ES:nothing
ORG 100H

entry: JMP install

divisor dw 400h

onTicks = 3
offTicks = 1
totalTicks = (onTicks+offTicks)

beepTick db 0

pendingBeeps db 0


;
; new clock interrupt handler
;
oldClock dd 0

newClock:
PUSH AX
CMP pendingBeeps,0
JNZ beepActive

clockDone:
POP AX
JMP oldClock

beepActive:
INC beepTick
CMP beepTick,1
JZ firstTick
CMP beepTick,onTicks
JZ turnOff
CMP beepTick,totalTicks
JZ lastTick
JMP clockDone

firstTick:
MOV AX,divisor
OUT 42,AL
MOV AL,AH
OUT 42,AL ;set divisor
IN AL,61
OR AL,3
OUT 61,AL ;sound on
JMP clockDone

turnOff:
IN AL,61
AND AL,0FC
OUT 61,AL ;sound off
JMP clockDone

lastTick:
MOV beepTick,0
DEC pendingBeeps
JMP clockDone


;
; new video interrupt handler
;
oldVideo dd 0

newVideo:
CMP AX,0E07h ;write bell?
JZ trapBell

CMP AX,'BE'
JNZ videoDone
CMP BX,'LL'
JNZ videoDone
XCHG BX,AX
IRET

videoDone:
JMP oldVideo

trapBell:
INC pendingBeeps
STI
IRET

;
;
;
install:
PUSH CS
POP DS
MOV AX,'BE'
MOV BX,'LL'
INT 10

XOR AX,'LL'
XOR BX,'BE'
OR AX,BX
JNZ L01A2

MOV DX,OFFSET alreadyPresent
MOV AH,9
INT 21
INT 20

L01A2: MOV AX,3508h ;get clock-tick vector
INT 21
MOV DI,OFFSET oldClock
MOV [DI],BX
MOV [DI+2],ES

MOV AX,3510h ;get video vector
INT 21
MOV DI,OFFSET oldVideo
MOV [DI],BX
MOV [DI+2],ES

MOV DX,OFFSET newClock
MOV AX,2508h
INT 21

MOV DX,OFFSET newVideo
MOV AX,2510h
INT 21

MOV DX,OFFSET installOK
MOV AH,9
INT 21

MOV DX,OFFSET install
INT 27

alreadyPresent:
db 0d,0a,7,'*** Error - Bell intercept already installed!',0d,0a,'$'

installOK:
db 0d,0a,7,' Bell intercept installed!',0d,0a,'$'

code ENDS
;
END entry


  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : BELL.ZIP
Filename : TONE3.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/