Page 1 of 1

interrupt table

Posted: Sun May 12, 2002 3:57 pm
by unknown user
can someone please give me some asm code for defining the dos int 21h interrupt table? thanks.

Re:interrupt table

Posted: Sun May 12, 2002 7:40 pm
by ASHLEY4
To set it up do this:
;********set up IVT for int 21h***************
push ds
cli
xor ax, ax
mov ds, ax         
mov word [ds:21h*4], int21   
mov word [ds:21h*4+2], cs
sti
pop ds
;****************************************

int21:
sti            
cmp ah, 0
je near _func00
         
cmp ah, 1
je near _func01         

cmp ah, 2
je near _func02         

cmp ah, 7
je near _func07
         
;put more as required.
;********************
_func01:
xor ax, ax
int 16h
call keyout
iret
;*********************
_func02:
push ax
mov al, dl
call keyout
pop ax
iret
;**********************
_func07:
xor ax, ax
int 16h
iret
;***********************
;more as required.

hope this helps
\\\///
(@@)
ASHLEY4.

Re:interrupt table

Posted: Mon May 13, 2002 1:31 pm
by f2
unknown user wrote: can someone please give me some asm code for defining the dos int 21h interrupt table? thanks.
What exactly do you mean by defining this in the interrupt table? The IDT?

Re:interrupt table

Posted: Tue May 21, 2002 3:07 pm
by DynatOS
If they are talking about defining real mode interrupts, then they need to define (or redefine) the IVT (Interrupt Vector Table) found at offset 0000:0000 extending to 0000:03FF. The IVT is the real mode equivalent of the IDT. As far as I know, the initial IVT setup by the BIOS has interrupts pointing to BIOS memory, DOS IVT extensions point to routines written by DOS designers. Make sure you know what you want to do because the IVT is an index of 256*4 Byte descriptors and the IDT is an index of 256*8 Byte descriptors.