3-338
INSTRUCTION SET REFERENCE
JMPJump (Continued)
IF code-segment segment descriptor does not indicate a code segment
OR code-segment segment descriptor is conforming and DPL > CPL
OR code-segment segment descriptor is non-conforming and DPL
?
CPL
THEN #GP(code segment selector); FI;
IF code segment is not present THEN #NP(code-segment selector); FI;
IF instruction pointer is not within code-segment limit THEN #GP(0); FI;
tempEIP
<
DEST(offset);
IF GateSize=16
THEN tempEIP
<
tempEIP AND 0000FFFFH;
FI;
IF tempEIP not in code segment limit THEN #GP(0); FI;
CS
<
DEST(SegmentSelector); (* segment descriptor information also loaded *)
CS(RPL)
<
CPL
EIP
<
tempEIP;
END;
TASK-GATE:
IF task gate DPL < CPL
OR task gate DPL < task gate segment-selector RPL
THEN #GP(task gate selector); FI;
IF task gate not present THEN #NP(gate selector); FI;
Read the TSS segment selector in the task-gate descriptor;
IF TSS segment selector local/global bit is set to local
OR index not within GDT limits
OR TSS descriptor specifies that the TSS is busy
THEN #GP(TSS selector); FI;
IF TSS not present THEN #NP(TSS selector); FI;
SWITCH-TASKS to TSS;
IF EIP not within code segment limit THEN #GP(0); FI;
END;
TASK-STATE-SEGMENT:
IF TSS DPL < CPL
OR TSS DPL < TSS segment-selector RPL
OR TSS descriptor indicates TSS not available
THEN #GP(TSS selector); FI;
IF TSS is not present THEN #NP(TSS selector); FI;
SWITCH-TASKS to TSS
IF EIP not within code segment limit THEN #GP(0); FI;
END;
Flags Affected
All flags are affected if a task switch occurs; no flags are affected if a task switch does not occur.