samuelbrody1249
samuelbrody1249

Reputation: 4767

Meaning of 'vector' in asm context

For something like:

int $0x80

I understand that it is executing the int instruction on the destination operand value 0x80 or 128. And, if I'm understanding correctly, 128 is a system call and it'll execute the call that is stored in eax. However, what is the meaning of vector here?

The destination operand specifies a vector from 0 to 255, encoded as an 8-bit unsigned intermediate value.

Why not just use the word number here? Is there a specific meaning of vector here (and I suppose it's different than the meaning in C++ or math).

Upvotes: 1

Views: 1178

Answers (1)

old_timer
old_timer

Reputation: 71506

The term vector in this type of low level software context is a list of addresses, vectors. Often based on interrupts/exceptions. So the handler for interrupt 5 is the 5th (well 6th sometimes do the interrupts start with 0 or 1 (generically not specific to x86)).

So the int 0x80 itself is not a vector, but there is a vector table and offset 0x80 in that table is an address to the handler for that interrupt. That allows for a fixed size item in an easy to look up table, but the size of the handler can vary in size.

It would not be incorrect to call this interrupt 128, but the handler is based ona vector table. Which is another word for address.

Upvotes: 2

Related Questions