Interrupt vector table explained

An interrupt vector table (IVT) is a data structure that associates a list of interrupt handlers with a list of interrupt requests in a table of interrupt vectors. Each entry of the interrupt vector table, called an interrupt vector, is the address of an interrupt handler (also known as ISR). While the concept is common across processor architectures, IVTs may be implemented in architecture-specific fashions. For example, a dispatch table is one method of implementing an interrupt vector table.

Background

Most processors have an interrupt vector table, including chips from Intel, AMD, Infineon, Microchip[1] Atmel,[2] NXP, ARM[3] [4] etc.

Interrupt handlers

See main article: Interrupt handler.

Handling methods

An interrupt vector table is used in the three most popular methods of finding the starting address of the interrupt service routine:

"Predefined"

The "predefined" method loads the program counter (PC) directly with the address of some entry inside the interrupt vector table. The jump table itself contains executable code. While in principle an extremely short interrupt handler could be stored entirely inside the interrupt vector table, in practice the code at each entry is a single jump instruction that jumps to the full interrupt service routine (ISR) for that interrupt. The Intel 8080,[5] Atmel AVR[6] [7] and all 8051 and Microchip microcontrollers[8] use the predefined approach.

"Fetch"

The "fetch" method loads the PC indirectly, using the address of some entry inside the interrupt vector table to pull an address out of that table, and then loading the PC with that address. Each and every entry of the IVT is the address of an interrupt service routine. All Motorola/Freescale microcontrollers use the fetch method.

"Interrupt acknowledge"

For the "interrupt acknowledge" method, the external device gives the CPU an interrupt handler number. The interrupt acknowledge method is used by the Intel Pentium and many older microprocessors.

When the CPU is affected by an interrupt, it looks up the interrupt handler in the interrupt vector table, and transfers control to it.

See also

External links

Notes and References

  1. http://ww1.microchip.com/downloads/en/DeviceDoc/70189c.pdf "dsPIC33F Family Reference Manual"
  2. http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html "AVR Libc User Manual"
  3. Web site: Documentation – Arm Developer. 2020-07-26. developer.arm.com.
  4. Web site: Documentation – Arm Developer – AArch64 exception vector table. 2020-07-26. developer.arm.com.
  5. Book: Intel 8080 Microcomputer Systems User's Manual. September 1975. Intel Corporation. 24210843M. 2–11 Interrupt Sequences. 2058546.
  6. Roger L. Traylor. "Interrupts: AVR interrupt servicing"
  7. Gary Hill. "Atmel AVR Interrupt and Timing Subsystems: ATMEGA328P interrupt vector table"
  8. Book: Huang, Han-Wat . Pic Microcontroller: An Introduction to Software and Hardware Interfacing . 22 April 2013 . 2005 . Cengage Learning . 978-1-4018-3967-3 . 247.