Skip to content
Advanced Microprocessor

8086 Interrupt Vector Table (IVT) & Dedicated Types 0–4

1 KB Interrupt Vector Table, 256 vector types, dedicated Divide Error/NMI/Breakpoint/Overflow interrupts, and IRET.

Knova editors10 min readQuick checkSources

8086 Interrupt System and Vector Table

The 8086 processor features a comprehensive, multi-priority interrupt structure supporting up to 256 distinct interrupt sources. An interrupt can be generated by three mechanisms:

  1. External Hardware Interrupts: Applied to the physical NMI (Non-Maskable Interrupt) or INTR (Interrupt Request) pins.
  2. Software Interrupts: Explicitly invoked by the programmer using the INT n instruction, where n∈[0,255]n \in [0, 255].
  3. Internal Processor Exceptions: Automatically triggered by abnormal arithmetic conditions (e.g. divide by zero, signed overflow).

The Interrupt Vector Table (IVT)

The first 10241024 bytes (1 KB1\text{ KB}) of physical memory, ranging from 00000H00000\text{H} to 003FFH003\text{FF}\text{H}, are reserved exclusively for the Interrupt Vector Table (IVT).

The table stores the 4-byte starting addresses for all 256 Interrupt Service Routines (ISRs). Each entry consists of:

  • 2 bytes for the new offset address (Instruction Pointer, IPIP)
  • 2 bytes for the new segment base (Code Segment, CSCS)
IVT Base Pointer=Interrupt Type (N)×4\text{IVT Base Pointer} = \text{Interrupt Type } (N) \times 4
Interrupt TypeIVT Address Range (Hex)Dedicated Function / Assignment
Type 000000H−00003H00000\text{H} - 00003\text{H}Divide Error (Division by zero or quotient overflow)
Type 100004H−00007H00004\text{H} - 00007\text{H}Single Step / Trace (When Trap Flag TF=1)\text{Single Step / Trace (When Trap Flag } TF = 1)
Type 200008H−0000BH00008\text{H} - 0000\text{B}\text{H}NMI (Non-Maskable Hardware Interrupt pin)
Type 30000CH−0000FH0000\text{C}\text{H} - 0000\text{F}\text{H}Breakpoint Interrupt (Single-byte opcode CCH)\text{Breakpoint Interrupt (Single-byte opcode } \text{CCH})
Type 400010H−00013H00010\text{H} - 00013\text{H}Overflow Interrupt (Triggered by INTO if OF=1)\text{Overflow Interrupt (Triggered by } \texttt{INTO} \text{ if } OF = 1)
Type 5 - 3100014H−0007FH00014\text{H} - 0007\text{F}\text{H}Reserved by Intel for processor expansion
Type 32 - 25500080H−003FFH00080\text{H} - 003\text{FF}\text{H}User Available (Hardware via 8259 or Software INT n)\text{User Available (Hardware via 8259 or Software } \texttt{INT n})

The Five Dedicated Interrupts (Type 0 - Type 4)

  1. Type 0 (Divide Error): Generated automatically by the processor whenever a DIV or IDIV instruction attempts division by zero, or when the quotient is too large to fit in the destination register (e.g. dividing a 16-bit word by an 8-bit divisor where quotient >255> 255).
  2. Type 1 (Single Step): Activated when the Trap Flag (TFTF) is set to 11. The processor executes one instruction and immediately jumps to the Type 1 ISR, enabling debuggers to inspect registers and memory step-by-step.
  3. Type 2 (NMI): Edge-triggered on the rising edge of the NMI input pin. Cannot be masked by software (CLI has no effect). Reserved for critical system failures such as power loss detection, parity errors, and watchdog timers.
  4. Type 3 (Breakpoint): Generated by the instruction INT 3. It is encoded as a single byte (CCH\text{CC}\text{H}), allowing debuggers to insert it anywhere in code by temporarily overwriting a single opcode byte.
  5. Type 4 (Overflow): Software conditional interrupt invoked by INTO (Interrupt on Overflow). If the Overflow Flag (OFOF) is set following signed arithmetic, the processor jumps to Type 4 ISR; if OF=0OF = 0, execution continues with the next sequential instruction.

Step-by-Step Interrupt Processing Sequence

When an interrupt is accepted at the end of the current instruction cycle, the 8086 performs the following automated hardware sequence:

  1. Decrements Stack Pointer by 2 (SP←SP−2SP \leftarrow SP - 2) and pushes the 16-bit Flag Register onto the stack.
  2. Clears the Interrupt Flag (IF←0IF \leftarrow 0) to prevent further maskable interrupts, and clears the Trap Flag (TF←0TF \leftarrow 0) to disable single-step debugging inside the ISR.
  3. Decrements SPSP by 2 and pushes the current Code Segment (CSCS) onto the stack.
  4. Decrements SPSP by 2 and pushes the current Instruction Pointer (IPIP) onto the stack.
  5. Computes the vector address in the IVT:
    Vector Address=Type Number ×4\text{Vector Address} = \text{Type Number } \times 4
  6. Fetches the new IPIP from locations Address\text{Address} and Address+1\text{Address} + 1, and fetches the new CSCS from locations Address+2\text{Address} + 2 and Address+3\text{Address} + 3.
  7. Begins executing the Interrupt Service Routine.
Try it
Interrupt Vector Location Calculation: At which memory locations in the Interrupt Vector Table is the address for software interrupt INT 20H stored?

Sources

  1. 1.Intel 8086 Microprocessor Datasheet · reference · Intel (opens in a new tab)

Was this chapter useful?

Editors read every answer.

Star this chapter

Each star goes once to every reader who improved this chapter.

Finished reading?

Mark it to keep your place in the course.