CODESG SEGMENT ASSUME CS:CODESG ORG 100H MAIN: JMP SHORT LOAD OLDINT8 DD ? COUNT DW 275 ;275 x 54.94 ms =15 seconds ;---------------- this portion remains resident NEWINT8 PROC 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 ; MOV AH,0EH ;do it again MOV AL,7 INT 10H EXIT: JMP CS:OLDINT8 ;take care of INT 08 NEWINT8 ENDP ;----------------- this portion is run once only ASSUME CS:CODESG,DS:CODESG LOAD PROC NEAR MOV AH,35H ;get the current CS:IP MOV AL,08H ;for INT 08 INT 21H MOV WORD PTR OLDINT8,BX ;save them MOV WORD PTR OLDINT8+2,ES MOV AH,25H ;set CS:IP MOV AL,08H ;for the new INT 08 MOV DX,OFFSET NEWINT8 ;DX=offset IP, DS=CS set by COM INT 21H MOV DX,(OFFSET LOAD-OFFSET CODESG) ;find how many bytes resident ADD DX,15 ;round it MOV CL,4 ;to paragraph SHR DX,CL ;size and MOV AH,31H ;make it INT 21H ;resident LOAD ENDP CODESG ENDS END MAIN