User's Manual

SYSTEM-LEVEL NUMERIC PROGRAMMING
Dedicated and Reserved
1/0
Locations
The 80287
NPX
does not require that any memory addresses be set aside for special purposes. The
80287 does make use of
1/0
port addresses
in
the range 00F8H through
OOFFH,
although these
1/0
operations are completely transparent
to
the 80286 software. 80286 programs must not reference these
reserved
1/0
addresses directly.
To prevent any accidental misuse or other tampering with numeric instructions
in
the 80287, the 80286's
1/0
Privilege Level (IOPL) should be used
in
multiuser reprogrammable environments to restrict
application program access to the
1/0
address space and
so
guarantee the integrity of 80287 compu-
tations. Chapter Eight of the 80286 Operating System Writer's Guide contains more details regarding
the use of the
1/0
Privilege Level.
PROCESSOR INITIALIZATION AND CONTROL
One of the principal responsibilities of systems software
is
the initialization, monitoring, and control of
the hardware and software resources of the system, including the
80287 NPX. In this section, issues
related to system initialization and control are described, including recognition of the NPX, emulation
of the
80287
NPX
in software if the hardware
is
not available, and the handling of exceptions
that
may occur during the execution of the 80287.
System Initialization
During initialization of an 80286 system, systems software must
Recognize the presence or absence of the
NPX
Set flags
in
the 80286
MSW
to
reflect the state of the numeric environment
If
an 80287
NPX
is
present in the system, the
NPX
must be
Initialized
Switched into Prolecled mode
(if
desired)
All of these activities can be quickly and easily performed as part of the overall system initialization.
Recognizing. the
80287
NPX
figure
3-1
shuVv's
ali
cAulliplc
cf:(l
reccgr..iti~n
rc!!ti~e
th9..t
det~-!'!!line.5
Ulh~thp.r:!n
NPX
is
present~
and
distinguishes between the 80387 and the 8087/80287. This routine can be executed on any 80386,
80286,
or 8086 hardware configuration that has an
NPX
socket.
The example guards against the possibility of accidentally reading an expected value from a floating
data bus when
no
NPX
is
present. Data read from a floating bus
is
undefined.
By
expecting to read a
specific bit pattern from the NPX, the routine protects itself from the indeterminate state of the bus.
The example
also
avoids depending on any values
in:
reserved bits, thereby maintaining compatibility
with future numerics coprocessors.
3-2