
THE 80286 INSTRUCTION SET
RETURN TO SAME LEVEL:
Return selector must be
Selector index must be within its descriptor table limits else #GP (selector) Descriptor AR byte must indicate code segment else #GP (selector)
If
Top word on stack must be within stack limits else #SS(O) IP must be in code segment limit else #GP(O)
Load CS:IP from stack
Load
Increment SP by 4 plus the immediate offset if it exists Else
RETURN TO OUTER PRIVILEGE LEVEL:
Top (8 + immeqiate) bytes on stack must be within stack limits else #SS(O) Examine return CS selector (at SP+2) and associated descriptor:
Selector must be
Selector index must be within its descriptor table limits else #GP (selector) Descriptor AR byte must indicate code segment else #GP (selector)
If
Examine return SS selector (at SP+6+imm) and associated descriptor: Selector must be
Selector index must be within its descriptor table limits else #GP (selector) Selector RPL must equal the RPL of the return CS selector else #GP (selector) Descriptor AR byte must indicate a writable data segment else #GP (selector) Descriptor DPL must equal the RPL of the return CS selector else #GP (selector) Segment must be PRESENT else #SS (selector)
IP must be in code segment limit else # GP(O) Set CPL to the RPL of the return CS selector Load CS:IP from stack
Set CS RPL to CPL
Increment SP by 4 plus the immediate offset if it exists Load SS:SP from stack
Load the
If the current register setting is not valid for the outer level, set the register to null (selector = AR = 0)
To be valid, the register setting must satisfy the following properties: Selector index must be within descriptor table limits Descriptor AR byte must indicate data or readable code segment If segment is data or
DPL must be 2:: CPL, or
DPL must be 2:: RPL
PROTECTED MODE EXCEPTIONS
#GP, #NP, or #SS, as described in the above listing.
REAL ADDRESS MODE EXCEPTIONS
Interrupt 13 if the stack pop wraps around from OFFFFH to O.