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

 
Output of file : TONE.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

pendingBeeps db 0
nextDivisor dw 0533h
divisor1 dw 0533h
divisor2 dw 07f7h

;
; new clock interrupt handler
;
oldClock dd 0

newClock:
PUSH AX
CMP pendingBeeps,0
JNZ beepActive

clockDone:
POP AX
JMP oldClock

beepActive:
DEC pendingBeeps
JZ lastBeep

IN AL,61
AND AL,3
XOR AL,3
JZ L012C

MOV AL,0B6
OUT 43,AL

L012C: MOV AX,nextDivisor
OUT 42,AL
MOV AL,AH
OUT 42,AL
MOV AX,divisor2
XOR nextDivisor,AX
IN AL,61
OR AL,3
OUT 61,AL
JMP clockDone

lastBeep:
IN AL,61
AND AL,0FC
OUT 61,AL
MOV AX,divisor1
MOV nextDivisor,AX
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:
CMP pendingBeeps,0
JNZ L017D
MOV pendingBeeps,4

L017D: 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 13,10,7,'*** Error - Bell intercept already installed!',13,10,'$'

installOK:
db 13,10,7,' Bell intercept installed!',13,10,'$'

code ENDS
;
END entry


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