Skip to main content

Interrupt vector table and its use

Short answer

IVT is a table at 00000H–003FFH storing 4-byte vectors (IP,CS) per interrupt type at address 4×n. For software INT n, CPU pushes flags/CS/IP, loads vector. Hardware NMI uses fixed type 2; INTR gets type from PIC after INTA' and fetches vector similarly.

What is an Interrupt Vector Table (IVT)? How is it used to handle software and hardware interrupts in microprocessor (8086)? Explain.

Interrupt Vector Table (IVT)

The IVT is a table in the lowest 1 KB of memory (00000H–003FFH) that stores the starting addresses (vectors) of the 256 interrupt service routines. Each entry is 4 bytes: the 2-byte IP (low byte first) followed by the 2-byte CS. So the entry for interrupt type n is at address 4 × n.

TypesUse
0 – 4Dedicated: divide error, single step, NMI, breakpoint, overflow
5 – 31Reserved by Intel for future use
32 – 255Available to the user (software and hardware interrupts)
 Address   Content
 003FCH  | Type 255      |
   ...   |   ...         |
 00008H  | Type 2  (NMI) |
 00004H  | Type 1        |
 00000H  | Type 0        |
 (each 4-byte entry: IP low, IP high, CS low, CS high)

Use for software interrupts

  1. The program executes INT n (opcode CDH, then the type number). INT 3 is the 1-byte opcode CCH, and INTO is CEH.
  2. The CPU pushes FLAGS, clears IF and TF, and pushes CS and IP.
  3. It calculates 4×n and loads IP and CS from the table.
  4. The ISR executes, and IRET restores IP, CS and FLAGS.

Example: INT 21H → vector at 21H × 4 = 0084H. This is how DOS services are called.

Use for hardware interrupts

  • NMI has the fixed type 2, so the CPU takes the vector from 00008H.
  • INTR: after the INTA' cycles the interrupt controller (8259A) supplies the type number on the data bus. The CPU multiplies it by 4 and reads the vector in the same way. Different devices give different types, so each can have its own ISR.

The programmer or the operating system loads the ISR addresses into the IVT (for example with DOS function 25H) before the interrupt can be used.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 5 questions →