I have tried to write an assembly code to hang the keyboard and mouse (I try with keyboard now) . I searched in everywhere nearly (in references and articles and the old topic here also) and almost all show the same code by fetch the address of INT 9 and create new interrupt then make it be called rather than the original interrupt(9) . That is my code i had written:
.model tiny
.stack 100h
.data
old_ISR dd ?
.code
main proc far
mov ah,35h ; get interrupt vector
mov al,09 ; for int 9
INT 21h
mov word ptr old_ISR,BX ; address of original int9 saved
mov word ptr old_ISR,ES ; in ES:BX
mov ah,25h ; set interrupt vector
mov al,09h ; for int 9
mov DX,offset ISR ;is pointing to my ISR
INT 21h
mov ax,3100h ; to make my program resident
mov dx,1 ; in the memory
int 21h
ISR proc
push ax
nop ; do nothing
pop ax
iret
ISR endp
In ISR I do nothing because the main goal I aim to is to make the original int9 don't point to interrupt vector table that contain int9 but point to my ISR then the scancode will missed and that's what I want.... unfortunately for me that code does not work well at all and I don't know why! thanks for advise.
**************** Some modification ********************
.model tiny
.stack 100h
.data
old_ISR dd ?
.code
main proc far
mov ax;@data ;new modification
mov ds,ax ;new modification
mov ah,35h ; get interrupt vector
mov al,09 ; for int 9
INT 21h
mov word ptr old_ISR,BX ; address of original int9 saved
mov word ptr old_ISR,ES ; in ES:BX
mov ah,25h ; set interrupt vector
mov al,09h ; for int 9
mov DX,offset ISR ;is pointing to my ISR
INT 21h
mov ax,3100h ; to make my program resident
mov dx,1 ; in the memory
int 21h
main endp ; new modification
ISR proc
push ax
nop ; do nothing
pop ax
iret
ISR endp
end ; new modification
For MSDOS/DOSBOX: