
2-66
PRELIMINARY
Interrupts and Exceptions
Advanci ng the S tandar ds
In response to a maskable hardware interrupt
(INTR), the M II CPU issues interrupt acknowl-
edge bus cycles to read the vector number from
external hardware. These vectors should be in
the range 32 - 255 as vectors 0 - 31 are reserved.
Interrupt Descriptor Table
The interrupt vector number is used by the M
II CPU to locate an entry in the interrupt
descriptor table (IDT). In real mode, each IDT
entry consists of a four-byte far pointer to the
beginning of the corresponding interrupt
service routine. In protected mode, each IDT
entry is an eight-byte descriptor. The Interrupt
Descriptor Table Register (IDTR) specifies the
beginning address and limit of the IDT.
Following reset, the IDTR contains a base
address of 0h with a limit of 3FFh.
The IDT can be located anywhere in physical
memory as determined by the IDTR register.
The IDT may contain different types of descrip-
tors: interrupt gates, trap gates and task gates.
Interrupt gates are used primarily to enter a
hardware interrupt handler. Trap gates are
generally used to enter an exception handler or
software interrupt handler. If an interrupt gate
is used, the Interrupt Enable Flag (IF) in the
EFLAGS register is cleared before the interrupt
handler is entered. Task gates are used to make
the transition to a new task.
2.14.4 Interrupt and Exception
Priorities
As the M II CPU executes instructions, it
follows a consistent policy for prioritizing
exceptions and hardware interrupts. The priori-
ties for competing interrupts and exceptions
are listed in Table 2-33 (Page 2-67). Debug
traps for the previous instruction and the next
instructions always take precedence. SMM
interrupts are the next priority. When NMI and
maskable INTR interrupts are both detected at
the same instruction boundary, the M II
processor services the NMI interrupt first.
The M II CPU checks for exceptions in parallel
with instruction decoding and execution.
Several exceptions can result from a single
instruction. However, only one exception is
generated upon each attempt to execute the
instruction. Each exception service routine
should make the appropriate corrections to the
instruction and then restart the instruction. In
this way, exceptions can be serviced until the
instruction executes properly.
The M II CPU supports instruction restart after
all faults, except when an instruction causes a
task switch to a task whose task state segment
(TSS) is partially not present. A TSS can be
partially not present if the TSS is not page
aligned and one of the pages where the TSS
resides is not currently in memory.