This program beeps every 15 seconds unless you exit command prompt. I enjoyed running this, even adjusting the time and made it beep faster. People at home were worried and at the same time amazed of what i have done. Though i just read about this and revised a little. Try running this and enjoy!
;——————–initialize tsr———————-
init:
cli ; prevent further interrupts
mov ah, 35h ; get the current CS:IP
mov al, 08h ; of int 08
int 21h ; result to ES:BX
mov word ptr oldint8, bx ; save BX
mov word ptr oldint8+2, es ; save ES
mov ah, 25h ; set CS:IP
mov al, 08h ; for the new INT 08
mov dx, offset routine ; DX=offset IP,
int 21h ; DS=CS set by COM
mov ah, 31h ; request stay resident
mov dx, offset init ; set size of resident portion
sti ; restore interrupts
int 21h
oldint8 dd ?
count dw 275 ; 275 X 54.94 ms = 15 seconds
;———————–resident program—————————
routine:
dec cs: count ; is the time up?
jnz exit
mov cs: count, 275 ; if yes initialize the count
mov ah, 0eh ; and
mov al, 7 ; beep the speaker
int 10h
exit:
jmp cs: oldint8 ; take care of INT 08