Intel 64 and IA-32 Architectures Software Developer's Manual
Intel 64 and IA-32 Architectures Software Developer's Manual
Intel 64 and IA-32 Architectures Software Developer's Manual
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Documentation Changes<br />
IF tempEIP[31:16] is not zero THEN #GP(0); FI;<br />
EIP ← Pop();<br />
CS ← Pop(); (* <strong>32</strong>-bit pop, high-order 16 bits discarded *)<br />
tempEFLAGS ← Pop();<br />
EFLAGS ← (tempEFLAGS AND 257FD5H) OR (EFLAGS AND 1A0000H);<br />
ELSE (* Oper<strong>and</strong>Size = 16 *)<br />
IF top 6 bytes of stack are not within stack limits<br />
THEN #SS; FI;<br />
EIP ← Pop(); (* 16-bit pop; clear upper 16 bits *)<br />
CS ← Pop(); (* 16-bit pop *)<br />
EFLAGS[15:0] ← Pop();<br />
FI;<br />
END;<br />
PROTECTED-MODE:<br />
IF VM = 1 (* Virtual-8086 mode: PE = 1, VM = 1 *)<br />
THEN<br />
GOTO RETURN-FROM-VIRTUAL-8086-MODE; (* PE = 1, VM = 1 *)<br />
FI;<br />
IF NT = 1<br />
THEN<br />
GOTO TASK-RETURN; (* PE = 1, VM = 0, NT = 1 *)<br />
FI;<br />
IF Oper<strong>and</strong>Size = <strong>32</strong><br />
THEN<br />
IF top 12 bytes of stack not within stack limits<br />
THEN #SS(0); FI;<br />
tempEIP ← Pop();<br />
tempCS ← Pop();<br />
tempEFLAGS ← Pop();<br />
ELSE (* Oper<strong>and</strong>Size = 16 *)<br />
IF top 6 bytes of stack are not within stack limits<br />
THEN #SS(0); FI;<br />
tempEIP ← Pop();<br />
tempCS ← Pop();<br />
tempEFLAGS ← Pop();<br />
tempEIP ← tempEIP AND FFFFH;<br />
tempEFLAGS ← tempEFLAGS AND FFFFH;<br />
FI;<br />
IF tempEFLAGS(VM) = 1 <strong>and</strong> CPL = 0<br />
THEN<br />
GOTO RETURN-TO-VIRTUAL-8086-MODE;<br />
(* PE = 1, VM = 1 in EFLAGS image *)<br />
ELSE<br />
GOTO PROTECTED-MODE-RETURN;<br />
(* PE = 1, VM = 0 in EFLAGS image *)<br />
FI;<br />
<strong>IA</strong>-<strong>32</strong>e-MODE:<br />
IF NT = 1<br />
THEN #GP(0);<br />
ELSE IF Oper<strong>and</strong>Size = <strong>32</strong><br />
THEN<br />
IF top 12 bytes of stack not within stack limits<br />
26 <strong>Intel</strong> ® <strong>64</strong> <strong>and</strong> <strong>IA</strong>-<strong>32</strong> <strong>Architectures</strong> <strong>Software</strong> Developer’s <strong>Manual</strong> Documentation Changes