User's Manual

CHAPTER 2
PROGRAMMING NUMERIC APPLICATIONS
Programmers developing applications for the 80287 have a wide range of instructions and program-
ming alternatives from which to choose.
The following sections describe the
80287 instruction set in detail, and follow up with a discussion of
several of the programming facilities that are available to programmers of 80287.
THE
80287
NPX INSTRUCTION SET
This section describes the operation of all 80287 instructions. Within this section, the instructions are
divided into six functional classes:
Data Transfer instructions
Arithmetic instructions
Comparison instructions
Transcendental instructions
Constant instructions
Processor Control instructions
At the end of this section, each of the instructions
is
described in terms of its execution speed, bus
transfers, and exceptions,
as
well
as a coding example for each combination of operands accepted by
the instruction. For easy reference, this information
is
concentrated into a table, organized alphabeti-
cally by instruction mnemonic.
Throughout this section, the instruction set
is
described
as
it appears
to
the ASM286 programmer
who
is
coding a program. Appendix A covers the actual machine instruction encodings, which are princi-
pally of use to those reading unformatted memory dumps, monitoring instruction fetches
on
the bus,
or writing exception handlers.
Compatibility with the
8087
NPX
The instruction set for the 80287
NPX
is
largely the same
as
that for the 8087
NPX
used with 8086
and 8088 systems. Most object programs generated for the 8087
will
execute without change on the
80287.
Several instructions are
new
to the 80287, and several 8087 instructions perform
no
useful
function
on
the 80287. Appendix B at the back of this manual gives details of these instruction set
differences and of the differences in the
ASM86 and ASM286 assemblers.
Numeric Operands
The typical
NPX
instruction accepts one or two operands as inputs, operates
on
these, and produces a
result
as
an output. Operands are most often (the contents of) register or memory locations. The operands
of some instructions are predefined; for example,
FSQRT always takes the square root
of
the number
in the top stack element. Others allow, or require, the programmer to explicitly code the operand(s)
along with the instruction mnemonic.
Still others accept one explicit operand and one implicit operand,
which
is
usually the top stack element.
2-1