Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

handling the IDT

Status
Not open for further replies.

nicovda

IS-IT--Management
Oct 4, 2004
19
BE
Something weard is happening. I'm trying (for debugging) to put the correct offset in the 33rd interrupt gate of the IDT. I intialize a variable called IDT33_offset.

This code doesn't work :


Chg_Init_Int33 proc near

push eax
push ebx
push edx

sidt fword ptr IDT_Limit
mov eax, IDT_BaseAddress
mov ebx, 033h
shl ebx, 3
add eax, ebx
mov IDT33_offset, eax

cli
mov dx, 8046h
mov word ptr [IDT33_offset+6], dx
mov dx, 332Eh
mov word ptr [IDT33_offset], dx
sti

pop edx
pop ebx
pop eax
ret

Chg_Init_Int33 endp

while this works (only difference : I use directly eax instead of passing his value in INT33_offset) :


Chg_Init_Int33 proc near

push eax
push ebx
push edx

sidt fword ptr IDT_Limit
mov eax, IDT_BaseAddress
mov ebx, 033h
shl ebx, 3
add eax, ebx
mov IDT33_offset, eax

cli
mov dx, 8046h
mov word ptr [eax+6], dx
mov dx, 332Eh
mov word ptr [eax], dx
sti

pop edx
pop ebx
pop eax
ret

Chg_Init_Int33 endp

I'm puzzled...
Any help?

Thanks in advance.

Nico.
 
Nico,

You try'ed to make a indirect indirect mov to the table
entry.
The double indirect can only be perform thrue a register
in the 80x86 range of cpu's.

In other cpu's you use the following line:

mov [[IDT33_offset]],dx

in your case the value in dx is written into the memory
location IDT33_offset instead of your desirred location
[IDT33_offset] meaning the offset in the IDT table.

By using eax as the pointer register the adres is taken
from the memory location that eax points to, that is
the value of IDT33_offset.

And so mov [eax],dx work fine but putting dx into the
variable IDT33_offset as is in mov [IDT33_offset],dx
doesn't.

I hope you understand my poor englisch and now know the
devirange.

regards,

Tessa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top