interrupt table

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
unknown user

interrupt table

Post by unknown user »

can someone please give me some asm code for defining the dos int 21h interrupt table? thanks.
ASHLEY4

Re:interrupt table

Post 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.
f2

Re:interrupt table

Post 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?
DynatOS

Re:interrupt table

Post 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.
Post Reply