I noticed that the Interrupt Vector Table page in the wiki lacks a piece of information vital to the reading and modification of the IVT: It does not mention that the memory addresses stored in the interrupt vectors are in reverse.
For example, modifying the interrupt vector of interrupt 0x21 to point to 0x7650:0x7B4F:
According to the article, once the interrupt vector is written, it should look like this:
Code: Select all
0x76 0x50 0x7B 0x4F
Code: Select all
mov ax, 0x7650
mov es, ax
mov WORD [es:0x0000], 0x7B4F ; Put the offset of INT 0x00 in the IVT
mov WORD [es:0x0002], ax ; Put the segment of INT 0x00 in the IVT
Therefore, once the interrupt vector is written, it should look like this:
Code: Select all
0x4F 0x7B 0x50 0x76
Code: Select all
mov ax, 0x7650
mov es, ax
mov ax, 0x7B4F
mov BYTE [es:0x0000], al ; Put the offset of INT 0x00 in the IVT
mov BYTE [es:0x0001], ah ; Put the offset of INT 0x00 in the IVT
mov ax, 0x7650
mov BYTE [es:0x0002], al ; Put the segment of INT 0x00 in the IVT
mov BYTE [es:0x0003], ah ; Put the segment of INT 0x00 in the IVT
Thanks,
-U238