up: Chapter 9 -- Exceptions and Interrupts
prev: 9.6 Interrupt Tasks and Interrupt Procedures
next: 9.8 Exception Conditions


9.7 Error Code

With exceptions that relate to a specific segment, the processor pushes an error code onto the stack of the exception handler (whether procedure or task). The error code has the format shown in Figure 9-7 . The format of the error code resembles that of a selector; however, instead of an RPL field, the error code contains two one-bit items:
  1. The processor sets the EXT bit if an event external to the program caused the exception.
  2. The processor sets the I-bit (IDT-bit) if the index portion of the error code refers to a gate descriptor in the IDT.
If the I-bit is not set, the TI bit indicates whether the error code refers to the GDT (value 0) or to the LDT (value 1). The remaining 14 bits are the upper 14 bits of the segment selector involved. In some cases the error code on the stack is null, i.e., all bits in the low-order word are zero.


up: Chapter 9 -- Exceptions and Interrupts
prev: 9.6 Interrupt Tasks and Interrupt Procedures
next: 9.8 Exception Conditions