Professional Documents
Culture Documents
Chapter 14
Chapter 14
SIMID Technologies
Introduction
• The Intel family of arithmetic coprocessors
includes the 8087, 80287, 80387SX,
80387DX, and 80487SX for use
with the 80486SX microprocessor.
• This chapter provides detail on the entire
family of arithmetic coprocessors.
• Many programs now require or at least
benefit from a coprocessor.
ZE
• A zero error indicates the divisor was zero while the
dividend is a noninfinity or nonzero number.
IE
• An invalid error indicates a stack overflow or underflow, indeterminate form
(0 ÷ 0, +∞, –∞, etc.), or use of a NAN as an operand.
– indicates errors such as produced by taking the square root of a negative number, etc.
RC
• Rounding control determines the type of
rounding, as defined in Figure 14–6.
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium,
Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Copyright ©2009 by Pearson Education, Inc.
Architecture, Programming, and Interfacing, Eighth Edition Upper Saddle River, New Jersey 07458 • All rights reserved.
Barry B. Brey
Control Register Bits
PC
• The precision control sets the precision
of the result, as defined in Figure 14–6.
Exception Masks
• Determine whether the error indicated by the exception affects the error bit
in the status register.
– if logic 1 is placed in an exception control bits,
the corresponding status register bit is masked
FABS
• Changes the sign of the top of the stack to
positive.
FCHS
• Changes the sign from positive to negative
or negative to positive.
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium,
Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Copyright ©2009 by Pearson Education, Inc.
Architecture, Programming, and Interfacing, Eighth Edition Upper Saddle River, New Jersey 07458 • All rights reserved.
Barry B. Brey
Comparison Instructions
• Examine data at the top of the stack in
relation to another element and return
the result of the comparison in the status
register condition code bits C3–C0.
FCOM
• Compares the floating-point data at the top
of the stack with an operand, which may be
any register or any memory operand.
– if not coded with the instruction, the next stack
element ST(1) is compared with the stack top ST
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium,
Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Copyright ©2009 by Pearson Education, Inc.
Architecture, Programming, and Interfacing, Eighth Edition Upper Saddle River, New Jersey 07458 • All rights reserved.
Barry B. Brey
Comparison Instructions
FCOMP/FCOMPP
• Both perform as FCOM, but also pop one
or two data from the stack.
FICOM/FICOMP
• The top of the stack is compared with the integer stored at a memory
operand.
– FICOMP also pops the top of the stack
FSINCOS
• Finds sine and cosine of ST, expressed in
radians, and leaves results as ST = sine and
ST(1) = cosine.
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium,
Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Copyright ©2009 by Pearson Education, Inc.
Architecture, Programming, and Interfacing, Eighth Edition Upper Saddle River, New Jersey 07458 • All rights reserved.
Barry B. Brey
Transcendental Operations
FYL2X
• Finds Y log2 X.
– value X is taken from the stack top
– Y is taken from ST(1)
• Result is found at the stack top after a pop.
– value of X must range between 0 and ∞
– value of Y must be between –∞ and +∞
• A logarithm with any positive base (b) is found by equation LOG b X = (LOG2 b)–1 LOG2 X.
FSTCW
• Stores the control register into the
word-sized memory operand.
FCLEX
• Clears the error flags in the status register
and also the busy flag.
FRSTOR
• Restores the state of the machine from memory. This instruction
is used to restore
the information saved by FSAVE.
FLDENV
• Reloads the environment saved by FSTENV.
FINCSP
• Increments the stack pointer.
The Intel Microprocessors: 8086/8088, 80186/80188, 80286, 80386, 80486 Pentium,
Pentium Pro Processor, Pentium II, Pentium, 4, and Core2 with 64-bit Extensions Copyright ©2009 by Pearson Education, Inc.
Architecture, Programming, and Interfacing, Eighth Edition Upper Saddle River, New Jersey 07458 • All rights reserved.
Barry B. Brey
Figure 14–9 Memory format for the FSTENV instruction: (a) real mode and (b)
protected mode.
FFREE
• Frees a register by changing the destination
register’s tag to empty.
– does not affect the contents of the register
FWAIT
• Causes the microprocessor to wait for the coprocessor
to finish an operation.
– should be used before the microprocessor accesses memory
data affected by the coprocessor