COPROCESSOR HARDWARE INTERFACE
~B~b/67/~~/lab
MACRO
ASSEMBLER
Test
for
presence
of
a Numerics Chip.
Revision
1."
PAGE
1
DOS
3.2B (B33-Nl
aB~b/671a6/16b
MACRO
ASSEMBLER
V2.B
ASSEMBLY
Of
MODULE
TEST-
NPX
OBJECT
MODULE
PLACED
IN fINDNPX.oBJ
LaC
OBJ
BBBB
(18B
1111
l
e9C8 1111
BBBB
BBBB
9BDBE3
BBB3
BEBBBB
BBBb
C7B~5A5A
BBBBA
9BDD3C
BBn
aB3CBB
BB1B
752A
BB12
9BD93C
BB15
~aB~
BB17
253f18
BB1A
3D3fBB
BBH'
751D
LINE
7
~
9
18
11
12
13
H
15
lb
17
18
19
2B
21
22
23
2~
25
2b
27
2~
29
3B
31
32
33
3~
35
3b
37
38
39
~B
~l
~2
~3
~~
~5
~b
~7
.
~6
SOURCE
+1
StitleC'Test
for
presence
of
a Numerics Chip.
Revision
1.0')
nalle
Test_NPX
stack
segment
stack
'
stack'
dw
lBB
dup
(?
l
sst
dw
stack
ends
data segment
public
'data'
temp
dw
Bh
data ends
dgroup
group
data,
stack
cgroup
group
code
code
segllent public 'code'
assume
cs: cgroup,
ds:
dgroup
start:
Look
for
an
8B87. 8B287.
i387
SX
or
i387
DX
NPX.
Note
that
we
cannot execute
WAIT
on
lIB8b/M
if
no
8887
is
present.
,
test_npx:
fninit
;
nust
use non"wait form
si
,offset
dgroup:
terap
mov
mov
fnstsw
cmp
jne
word
ptr [sil,SASAH ;
Initialize
temp
to non-zero value
[sil
nust
use
non-wait
form
of
fstsw
It
is
not necessary to use a
blAIT
instruction
after
fnstsw or fnstew.
Do
not use
one
here.
byte ptr
[sil,"
See
if
correct"
status
with zeroes
was
read
no_npx
Jump
if
not a
valid
status
word.
meaning
no
NPX
Naill
see
if
ones
.can
be
correctly
written
from
the control
word.
fnstcw
mov
and
cmp
jne
[sil
ax.
[sil
ax.
193fh
ax.3fh
no_npx
Look
at
the control
word;
do
not
use
k1AIT
form
»0
not use a
IIIAIT
instruction
here!
See
if
ones
can
be
written
by
NPX
See
if
selected
parts
of
control.
word
look
OK
{heck that· ones
and
zeroes
were
correctly
read
Jump
if
no
NPX
is
installed
Somne
numerics chip
is
installed.
NPX
-instructions
and.
klAIT
are
nOIll
safe.
See
if
the
NPX
is
an
8B~7.
~B2a7.
i387
SX
or
i387
DX
NPX
This code
is
necessary
if
a
denormal
exception handler
is
used
or the
new
i367
J)X
NPX
instructions
will
be
used .
Figure 5-3. Software Routine to Reco.gnize the Coprocessor
5-7