1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML 2.0//EN">
4 <TITLE>80386 Programmer's Reference Manual -- Section
14.3</TITLE>
7 <B>up:
</B> <A HREF=
"c14.htm">
8 Chapter
14 --
80386 Real-Address Mode
</A><BR>
9 <B>prev:
</B> <A HREF=
"s14_02.htm">14.2 Registers and Instructions
</A><BR>
10 <B>next:
</B> <A HREF=
"s14_04.htm">14.4 Entering and Leaving Real-Address Mode
</A>
14 <H1>14.3 Interrupt and Exception Handling
</H1>
15 Interrupts and exceptions in
80386 real-address mode work as much as they
16 do on an
8086. Interrupts and exceptions vector to interrupt procedures via
17 an interrupt table. The processor multiplies the interrupt or exception
18 identifier by four to obtain an index into the interrupt table. The entries
19 of the interrupt table are far pointers to the entry points of interrupt or
20 exception handler procedures. When an interrupt occurs, the processor
21 pushes the current values of CS:IP onto the stack, disables interrupts,
22 clears TF (the single-step flag), then transfers control to the location
23 specified in the interrupt table. An
<A HREF=
"IRET.htm">IRET
</A> instruction at the end of the
24 handler procedure reverses these steps before returning control to the
25 interrupted procedure.
27 The primary difference in the interrupt handling of the
80386 compared to
28 the
8086 is that the location and size of the interrupt table depend on the
29 contents of the IDTR (IDT register). Ordinarily, this fact is not apparent
30 to programmers, because, after RESET, the IDTR contains a base address of
0
31 and a limit of
3FFH, which is compatible with the
8086. However, the
32 <A HREF=
"LGDT.htm">LIDT
</A>
33 instruction can be used in real-address mode to change the base and limit
34 values in the IDTR . Refer to
35 <A HREF=
"c09.htm">Chapter
9</A>
36 for details on the IDTR , and the
37 <A HREF=
"LGDT.htm">LIDT
</A> and
<A HREF=
"SGDT.htm">SIDT
</A> instructions.
38 If an interrupt occurs and the corresponding
39 entry of the interrupt table is beyond the limit stored in the IDTR, the
40 processor raises exception
8.
44 <B>up:
</B> <A HREF=
"c14.htm">
45 Chapter
14 --
80386 Real-Address Mode
</A><BR>
46 <B>prev:
</B> <A HREF=
"s14_02.htm">14.2 Registers and Instructions
</A><BR>
47 <B>next:
</B> <A HREF=
"s14_04.htm">14.4 Entering and Leaving Real-Address Mode
</A>