Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
4-262 Vol. 2B
INSTRUCTION SET REFERENCE, N-Z
For each of ES, FS, GS, and DS
DO
IF segment selector index is not within descriptor table limits
or segment descriptor indicates the segment is not a data or readable code segment
or if the segment is a data or non-conforming code segment
and the segment descriptor’s DPL < CPL or RPL of code segment’s segment selector
THEN SegmentSelector ← 0; (* SegmentSelector invalid *)
OD;
ESP ESP + SRC; (* Release parameters from calling procedure’s stack *)
Flags Affected
None.
Protected Mode Exceptions
#GP(0) If the return code or stack segment selector NULL.
If the return instruction pointer is not within the return code
segment limit
#GP(selector) If the RPL of the return code segment selector is less then the
CPL.
If the return code or stack segment selector index is not within
its descriptor table limits.
If the return code segment descriptor does not indicate a code
segment.
If the return code segment is non-conforming and the segment
selector’s DPL is not equal to the RPL of the code segment’s
segment selector
If the return code segment is conforming and the segment
selector’s DPL greater than the RPL of the code segment’s
segment selector
If the stack segment is not a writable data segment.
If the stack segment selector RPL is not equal to the RPL of the
return code segment selector.
If the stack segment descriptor DPL is not equal to the RPL of
the return code segment selector.
#SS(0) If the top bytes of stack are not within stack limits.
If the return stack segment is not present.
#NP(selector) If the return code segment is not present.
#PF(fault-code) If a page fault occurs.
#AC(0) If an unaligned memory access occurs when the CPL is 3 and
alignment checking is enabled.