Intel ARCHITECTURE IA-32 User Manual Page 181

  • Download
  • Add to my manuals
  • Print
  • Page
    / 636
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 180
Vol. 3A 5-5
INTERRUPT AND EXCEPTION HANDLING
5.4 SOURCES OF EXCEPTIONS
The processor receives exceptions from three sources:
Processor-detected program-error exceptions.
Software-generated exceptions.
Machine-check exceptions.
5.4.1 Program-Error Exceptions
The processor generates one or more exceptions when it detects program errors during the
execution in an application program or the operating system or executive. The IA-32 architec-
ture defines a vector number for each processor-detectable exception. Exceptions are classified
as faults, traps, and aborts (see Section 5.5, “Exception Classifications”).
5.4.2 Software-Generated Exceptions
The INTO, INT 3, and BOUND instructions permit exceptions to be generated in software.
These instructions allow checks for exception conditions to be performed at points in the
instruction stream. For example, INT 3 causes a breakpoint exception to be generated.
The INT n instruction can be used to emulate exceptions in software; but there is a limitation. If
INT n provides a vector for one of the IA-32 architecture exceptions, the processor generates an
interrupt to the correct vector (to access the exception handler) but does not push an error code
on the stack. This is true even if the associated hardware-generated exception normally produces
an error code. The exception handler will still attempt to pop an error code from the stack while
handling the exception. Because no error code was pushed, the handler will pop off and discard
the EIP instead (in place of the missing error code). This sends the return to the wrong location.
5.4.3 Machine-Check Exceptions
The P6 family and Pentium processors provide both internal and external machine-check mech-
anisms for checking the operation of the internal chip hardware and bus transactions. These
implementation dependent. When a machine-check error is detected, the processor signals a
machine-check exception (vector 18) and returns an error code.
See Chapter 5, “Interrupt 18—Machine-Check Exception (#MC)” and Chapter 14, “Machine-
Check Architecture,” for more information about the machine-check mechanism.
5.5 EXCEPTION CLASSIFICATIONS
Exceptions are classified as faults, traps, or aborts depending on the way they are reported and
whether the instruction that caused the exception can be restarted without loss of program or task
continuity.
Page view 180
1 2 ... 176 177 178 179 180 181 182 183 184 185 186 ... 635 636

Comments to this Manuals

No comments