![](http://datasheet.mmic.net.cn/330000/Intel387-sx_datasheet_16416404/Intel387-sx_9.png)
Intel387
TM
SX MATH COPROCESSOR
3.0
PROGRAMMING INTERFACE
The Intel387 SX Math CoProcessor effectively ex-
tends to an Intel386 Microprocessor system addi-
tional instructions, registers, data types, and inter-
rupts specifically designed to facilitate high-speed
floating point processing. All communication be-
tween the CPU and the Math CoProcessor is trans-
parent to applications software. The CPU automati-
cally controls the Math CoProcessor whenever a
numerics instruction is executed. All physical memo-
ry and virtual memory of the CPU are available for
storage of the instructions and operands of pro-
grams that use the Math CoProcessor. All memory
addressing modes, including use of displacement,
base register, index register, and scaling are avail-
able for addressing numerical operands.
The Intel387 SX Math CoProcessor is software com-
patible with the Intel387 DX Math CoProcessors and
supports all applications written for the Intel386 CPU
and Intel387 Math CoProcessors.
3.1 Instruction Set
The Intel386 CPU interprets the pattern 11011B in
most significant five bits of an instruction as an op-
code intended for a math coprocessor. Instructions
thus marked are called ESCAPE or ESC instruction.
The typical Math CoProcessor instruction accepts
one or two operands and produces one or some-
times two results. In two-operand instructions, one
operand is the contents of the Math CoProcessor
register, while the other may be a memory location.
The operands of some instructions are predefined;
for example, FSQRT always takes the square root of
the number in the top stack element.
The Intel387 SX Math CoProcessor instruction set
can be divided into six groups. The following sec-
tions gives a brief description of each instruction.
Section 8.0 defines the instruction format and byte
fields. Further details can be obtained from the
Intel387 User’s Manual, Programmer’s Reference,
Order
Y
231917.
3.1.1 DATA TRANSFER INSTRUCTIONS
The class includes the operations that load, store,
and convert operands of any support data types.
Real Transfers
FLD
Load Real (single, double, extended)
FST
Store Real (single, double)
FSTP
Store Real and pop (single, double, ex-
tended)
FXCH Exchange registers
Integer Transfers
FILD
Load (convert from) Integer (word, short,
long)
FIST
Store (convert to) Integer (word, short)
FISTP Store (convert to) Integer and pop (word,
short, long)
Packed Decimal Transfers
FBLD
Load (convert from) packed decimal
FBSTP Store packed decimal and pop
3.1.2 ARITHMETIC INSTRUCTIONS
This class of instructions provide variations on the
basic add, subtract, multiply, and divide operations
and a number of other basic arithmetic operations.
Operands may reside in registers or one operand
may reside in memory.
Addition
FADD
Add Real
FADDP
Add Real and pop
FIADD
Add Integer
Subtraction
FSUB
Subtract Real
FSUBP
Subtract Real and pop
FISUB
Subtract Integer
FSUBR
Subtract Real reversed
FSUBRP Subtract Real reversed and pop
FISUBR
Subtract Integer reversed
Multiplication
FMUL
Multiply Real
FMULP
Multiply Real and pop
FIMUL
Multiply Integer
Division
FDIV
Divide Real
FDIVP
Divide Real and pop
FIDIV
Divide Integer
FDIVR
Divide Real reversed
FDIVRP
Divide Real reversed and pop
FIDIVR
Divide Integer reversed
9
9