News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

value of interrupt vector ???

Started by t48605, June 08, 2006, 03:20:15 AM

Previous topic - Next topic

t48605


mov ax,0000h
mov ds,ax
mov bx,0024h
mov ax,5800h
mov [bx],ax
mov ax,f000h
mov [bx+02],ax

above is the assumption and here is 4 result for choice ( 8086/8088 microprocessor )
A. int 03h will have the value of 5000:2800
B. int 06h will have the value of F000:5800
C. int 00h will have the value of 5800:F000
D. int 09h will have the value of F000:5800
so ... anyone help me to understand this test , I think that the assumption and choice is not concern , why have to ask about int here , while I know that the address of int is validly located , ie , int 00h has the address IP is 0000h ; 0001h and CS is 0002h ; 0003h  but the assumption is just about DS:BX :(
thanks !!!

MichaelW

Interrupt vectors are 4 bytes each with the vector for interrupt 0 stored at offset 0 in the table. The offset address of an interrupt vector in the table is calculated as the interrupt number * 4, so for example, the offset of the interrupt 9 vector would be 9*4 = 36d = 24h. The segment address of the handler is stored in the word at the higher address, and the offset address of the handler in the word at the lower address.

eschew obfuscation

t48605

well I first choice B because I think 06h * 4 = 24h , now as you said it 's D
but do you know why we need 4 bytes , why not 2 nibbles
for ie 0000:0024h has the value 5800
        0000:0025h has the value F000
while the fact is 0000:0024 -> 00
                       0000:0025 -> 58
                       0000:0026 -> 00
                       0000:0027 -> F0

MichaelW

6 * 4 = 24d = 18h

The segment and offset addresses that make up an interrupt vector are 16-bit word values that will not fit into a nibble (4 bits) or byte (8 bits).

Words are stored in memory with the bytes reversed, so for example the word F000h would be stored in memory as:

<lower address>00,F0<higher address>

And dwords (32 bits) are stored in memory with the words reversed, so for example the dword F0005800h would be stored as:

<lower address>00,58,00,F0<higher address>
eschew obfuscation

t48605

 http://img132.imageshack.us/img132/5547/whyhasnumber2tc.png
well , one more question , could you tell me about the number in red circle , whats create that number ?
thanks !!!

Ossa

Create?

That is the pin number of the DB7 pin (or the D7 pin depending upon which data sheet you look at) - this is the MSB on the Data Bus, which in this case is a bidirectional bus (so the pin connections are tri-state).

Nothing "created" the number - it was simply decided that pin 27 corresponds to that function. I'm not too sure that I understand what you mean.
Ossa
Website (very old): ossa.the-wot.co.uk

t48605

that 's simple  ::)
thanks   :wink