;upon activation of ALT F10 the system will beep ;this program needs to be converted to a COM file using the EXE2BIN before it is run ;See Chapter 2 for the process of COM file creation. CODESG SEGMENT ASSUME CS:CODESG ORG 100H MAIN: JMP SHORT LOAD OLDINT9 DD ? ;32-bit area to save the CS:IP of INT 09 ;--------------- this portion remains resident NEWINT9 PROC PUSH AX MOV AH,2 ;get the keyboard status byte INT 16H ;using BIOS INT 16 TEST AL,00001000B ;check for ALT JZ OVER ;if no ALT key then exit IN AL,60H ;get the scan code CMP AL,44H ;see if it is F10 key JNE OVER ;if no then exit MOV AH,0EH ;if yes beep the speaker MOV AL,07 ;using BIOS INT 10H ;INT 10H OVER: POP AX ;restore the reg JMP CS:OLDINT9 ;and perform INT 09 NEWINT9 ENDP ;--------------- this portion is run once only during the initialization ASSUME CS:CODESG,DS:CODESG LOAD PROC NEAR MOV AH,35H ;get the vector values MOV AL,09H ;for INT 09 INT 21H MOV WORD PTR OLDINT9,BX ;save MOV WORD PTR OLDINT9+2,ES ;them MOV AH,25H ;set the vector for MOV AL,09H ;the new INT 09 MOV DX,OFFSET NEWINT9 ;DX=IP, DS=CS set by COM INT 21H MOV DX,(OFFSET LOAD - OFFSET CODESG) ;find how how many bytes resident ADD DX,15 ;make it MOV CL,4 ;multiple of 16 bytes SHR DX,CL MOV AH,31H ;and make it INT 21H ;resident LOAD ENDP CODESG ENDS END MAIN