
MILITARY i387
TM
MATH COPROCESSOR
15
0
TAG (7)
TAG (6)
TAG (5)
TAG (4)
TAG (3)
TAG (2)
TAG (1)
TAG (0)
NOTE:
The index i of tag(i) is
not
top-relative. A program typically uses the ‘‘top’’ field of Status Word to determine which tag(i)
field refers to logical top of stack.
TAG VALUES:
00
e
Valid
01
e
Zero
10
e
QNaN, SNaN, Infinity, Denormal and Unsupported Formats
11
e
Empty
Figure 2.1. i387
TM
NPX Tag Word
2.3 Register Set
Figure 1.1 shows the i387 NPX register set. When
an i387 NPX is present in a system, programmers
may use these registers in addition to the registers
normally available on the i386 processor.
2.3.1 DATA REGISTERS
i387 processor computations use the i387 NPX’s
data registers. These eight 80-bit registers provide
the equivalent capacity of twenty 32-bit registers.
Each of the eight data registers in the i387 NPX is 80
bits wide and is divided into ‘‘fields’’ corresponding
to the NPXs extended-precision real data type.
The i387 NPX register set can be accessed either as
a stack, with instructions operating on the top one or
two stack elements, or as a fixed register set, with
instructions operating on explicitly designated regis-
ters. The TOP field in the status word identifies the
current top-of-stack register. A ‘‘push’’ operation
decrements TOP by one and loads a value into the
new top register. A ‘‘pop’’ operation stores the value
from the current top register and then increments
TOP by one. Like i386 microprocessor stacks in
memory, the i387 NPX register stack grows ‘‘down’’
toward lower-addressed registers.
Instructions may address the data registers either
implicitly or explicitly. Many instructions operate on
the register at the TOP of the stack. These instruc-
tions implicitly address the register at which TOP
points. Other instructions allow the programmer to
explicitly specify which register to user. This explicit
register addressing is also relative to TOP.
2.3.2 TAG WORD
The tag word marks the content of each numeric
data register, as Figure 2.1 shows. Each two-bit tag
represents one of the eight numerics registers. The
principal function of the tag word is to optimize the
NPXs performance and stack handling by making it
possible to distinguish between empty and nonemp-
ty register locations. It also enables exception han-
dlers to check the contents of a stack location with-
out the need to perform complex decoding of the
actual data.
7