User's Manual

THE
80286
INSTRUCTION SET
2.
Call
Gate-The
offset part of the pointer
is
ignored. Instead, the entire address
of
the procedure
is
taken from the call gate descriptor entry.
If
the routine being entered
is
more privileged, then
a
new
stack (both SS and SP)
is
loaded from the task state segment
for
the
new
privilege level,
and parameters determined
by
the
word
count field of the call gate are copied from the old stack
to
the
new
stack.
3.
Task
Gate-The
current task's context
is
saved
in
its Task State Segment (TSS), and the TSS
named in the task-gate
is
used
to
load the
new
context. The selector
for
the outgoing task (from
TR)
is
stored into
the
new
TSS's link field, and the
new
task's Nested Task flag
is
set. The outgo-
ing task
is
left marked busy, the
new
TSS
is
marked busy, and execution resumes at the point at
which the
new
task
was
last suspended.
4.
Task State
Segment-The
current task
is
suspended and the
new
task initiated
as
in
3 above
except that there
is
no
intervening gate.
For long calls involving
no
task switch, the return link
is
the pointer
of
the instruction that
follows
the
CALL,
Le.,
the caller's CS and updated IP. Task switches invoked
by
CALLs are linked
by
storing
the outgoing task's
TSS. selector
in
the incoming TSS's link field and setting the Nested Task flag
in
the
new
task. Nested tasks must
be
terminated
by
an IRET. IRET releases the nested task and
follows
the back link
to
the calling task if the
NT
flag
is
set.
A precise list of the protection checks made and the actions taken
is
given
by
the following list:
CALL FAR:
If indirect then check access
of
EA
doubleword #GP(O) if limit violation
New CS selector must not
be
null else #GP(O)
Check that new
CS
selector index is within its descriptor table limits; else
#GP
(new
CS
selector)
Examine
AR
byte
of
selected descriptor for various legal values:
CALL CONFORMING CODE
SEGMENT:
DPL must be
~
CPL else
#GP
(code segment selector)
Segment must be PRESENT else
#NP
(code segment selector)
Stack must be big enough for return address else #SS(O)
IP
must be in code segment limit else #GP(O)
Load code segment descriptor into CS cache
Load
CS
with new code segment selector
Load
IP
with new offset
CALL NONCONFORMING CODE SEGMENT:
RPL must be
~
CPL else
#GP
(code segment selector)
DPL must be = CPL else
#GP
(code segment selector)
Segment must be PRESENT
else
#NP
(code segment selector)
Stack must be big enough
forreturn
address else #SS(O)
IP
must be
in
code segment limit else #GP(O)
Load code segment descriptor into
CS
cache
Load
CS
with new code segment selector
Set RPL
of
CS
to CPL
Load
IP
with new offset
CALL
TO
CALL GATE:
Call gate DPL must be
~
CPL else
#GP
(call gate selector)
Call
gate DPL must
be
~
RPL else
#GP
(call gate selector)
Call gate must be PRESENT else
#NP
(call gate selector)
Examine code segment selector
in
call gate descriptor:
Selector must not
be
null else #GP(O)
Selector
must be within its descriptor table limits else
#GP
(code segment selector)
AR
byte
of
selected descriptor must indicate code segment else
#GP
(code segment selector)
DPL
of
selected descriptor must be
~
CPL else
#GP(
code segment selector)
If non-conforming code segment and DPL < CPL then
8-24