I have got an assignment to modify an existing ISR.
Can someone guide me how to do so?
It is to write an assembly program that exploid an existing ISR and modify it.
In 16-bit assembly language:
Interrupt Service Routines are pointed to by the Interrupt Vector
Table occupying the first 1,024 bytes of physical address space.
Each IVT entry points to an interrupt handler routine, the IVT
entry has the format of an intel format far pointer. The processor
multiplies the interrupt number by 4 to index into the interrupt vector
Under DOS use 21/25 Set IVT Entry and 21/35 Get IVT Entry
jmp init handler: sti ; do stuff iret end equ $ init: mov dx, init ; DS:DX->Handler mov ah, 0x25 ; 21/25 mov al, 0x60 ; Interrupt Number 60h int 0x21 mov dx, end ; DX=Number of paragraphs to keep add dx, 0xf shr dx, 4 mov ax, 0x3100 ; 21/31 Terminate and Stay Resident int 0x21
Usually a program which is called by the interrupt mechanism
is loaded as a .COM or .EXE and terminates using INT 27 or INT 21/31
Terminate and Stay Resident.
It is usually a good idea to chain to the original handler, you can
retrieve a pointer in ES:BX to the original handler using INT 21/35
Chain to the original handler like this:
pushf cli call word far [orig_handler]
Tahnk you very much NotNull for you contribution. It is really usefull