CHƯƠNG TRÌNH THƯỜNG TRÚ NHẤN PHÍM F12 THAY THẾ PHÍM A


Mã:
.286
.Model Small
.Code
            org 100h
Begin:
            jmp Resident
            oldint9 dd ?

    NewInt9 Proc
            Push ax
	        In al,60h               	   ;doc ma quet al
            cmp al,58h
            je NewF12
            Pop ax
            jmp cs:oldint9
    NewF12:
            Push cx
            Mov ah,5
            Mov cx,1e61h
            Int 16h
            Pop cx

            Mov al,00100000b				;goi lenh EOI
            Out 20h,al
            Pop ax
            Iret
    NewInt9 EndP
    Resident:
            Mov ax,0000
            Mov es,ax
            Mov ax,es:[9h*4]
            Mov word ptr oldint9,ax

            Mov ax,es:[9h*4+2]
            Mov word ptr oldint9+2,ax

           CLI								;Ghi vao dia chi newint9 vao bang vector ngat
            Mov ax, offset NewInt9
            Mov es:[9h*4],ax
            Mov ax,cs
            Mov es:[9h*4+2],ax

            STI
            Mov dx,offset resident         ;thuong tru
            Int 27h
End Begin