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.
31 15 2 1 0
+---------------+----------------+-----------------+-------+-+-+-+
|################################| |T| |E|
|###########UNDEFINED############| SELECTOR INDEX | |I| |
|################################| |I| |X|
+---------------+----------------+-----------------+-------+-+-+-+