Jump to content

Interrupt vector table

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Wikideb0ch (talk | contribs) at 09:22, 7 April 2016 (Clarified interrupt vector in introduction, as requested by the clarify flag. Did not remove the clarify flag yet, waiting for somebody else to confirm). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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[clarification needed]. An interrupt vector is the address of the interrupt handler. While the concept is common across processor architectures, each IVT may be implemented in an architecture-specific fashion. 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 Infineon, Microchip[1] Atmel,[2] Freescale, AMD, Intel, etc.

Interrupt Handlers

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 and every entry is "JMP address" where the address is the address of the interrupt service routine (ISR) for that interrupt. The Atmel AVR[3][4] and all 8051 and Microchip microcontrollers[5] 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.[5] Each and every entry of the IVT is the address of an interrupt service routine. All Motorola/Freescale microcontrollers use the fetch method.[5]

"Interrupt Acknowledge"

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.[5]

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

See also

References

  1. ^ "dsPIC33F Family Reference Manual" section 29.1.1 Interrupt Vector Table
  2. ^ "AVR Libc User Manual" section: Introduction to avr-libc's interrupt handling
  3. ^ Roger L. Traylor. "Interrupts: AVR interrupt servicing"
  4. ^ Gary Hill. "Atmel AVR Interrupt and Timing Subsystems: ATMEGA328P interrupt vector table"
  5. ^ a b c d Huang, Han-Wat (2005). Pic Microcontroller: An Introduction to Software and Hardware Interfacing. Cengage Learning. p. 247. ISBN 978-1-4018-3967-3. Retrieved 22 April 2013.