3-612
INSTRUCTION SET REFERENCE
RETReturn from Procedure (Continued)
ELSE (* OperandSize=16 *)
EIP
<
Pop();
EIP
<
EIP AND 0000FFFFH;
CS
<
Pop(); (* 16-bit pop; segment descriptor information also loaded *)
CS(RPL)
<
CPL;
ESP
<
ESP + SRC; (* release parameters from called procedures stack *)
tempESP
<
Pop();
tempSS
<
Pop(); (* 16-bit pop; segment descriptor information also loaded *)
(* segment descriptor information also loaded *)
ESP
<
tempESP;
SS
<
tempSS;
FI;
FOR each of segment register (ES, FS, GS, and DS)
DO;
IF segment register points to data or non-conforming code segment
AND CPL > segment descriptor DPL; (* DPL in hidden part of segment register *)
THEN (* segment register invalid *)
SegmentSelector
<
0; (* null segment selector *)
FI;
OD;
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
descriptors DPL < CPL or RPL of code segments segment selector
THEN
segment selector register
<
null selector;
OD;
ESP
<
ESP + SRC; (* release parameters from calling procedures stack *)
Flags Affected
None.