EE6373 DSP Architectures

Exploring the Intel 8087

The features and operation of the Intel 8087 are explored using a few simple exercises based on DOS DEBUG.

The 8087 Numeric Processor Extension or "Math Coprocessor" was developed by Intel to extend the capabilities of the 8088/8086 family of processor to include floating point arithmetic. Although the original 8087 is now of purely historic interest, its operation is compatible with all its more recent incarnations, including the Intel Pentium processors. In this discussion, the "8087" will refer to any of these devices.

HARDWARE

Physically, the original 8087 chip was designed to be installed in parallel with the 8086 bus lines. As such it could monitor bus activity and intercept instruction codes intended for floating point operations. These eight special codes are found in the 8086 instruction set as "ESC #", covering hexadecimal opcodes D8..DF. In other words, any instruction beginning with an opcode in the range D8..DF cannot be executed by the 8086 but (provided an 8087 is installed) the instruction will be handled automatically by the math coprocessor. Note that this implies there is no immediate improvement gained by installing an 8087; only when its specific instructions are incorporated into a program will it ever come into play. Note that certain programs and packages will test for the presence of an 8087 and invoke different routines accordingly; these program create the false impresssion that the 8087 magically speeds up general purpose computing.

SOFTWARE

In software, the Intel mnenomics for the 8087 are written to begin with the letter 'F' (no normal 8086 mnemonics begin with 'F'). For example, the mnenomic ADD specifies an 8086-based integer addition, while the mnemonic FADD selects an 8087-based floating point addition.

8087 Capabilities are part of DEBUG and MASM

It may come as a surprise that 8087 instructions are included in DOS DEBUG. Similarly, DOS assemblers (such as MASM) and any software tools can be expected to support the 8087 instruction set. The following experiments use DOS DEBUG to explore the operation of the 8087 Numeric Processor Extension.


OVERVIEW OF DOS DEBUG

DEBUG is a simple command line tool to manipulate memory contents in MS-DOS computers. Only a few of its commands are necessary for this exercise. In each case, a small program will be entered at (hex) address 0100 and data will be stored at address 0200.

The commands to be used are (all arguments in hexadecimal):

COMMAND		FORMAT           DESCRIPTION
-------------------------------------------------------------------------
assemble	a [address]      Enter assembly language instructions
dump		d [address]      Display memory contents in hex
enter		e [address]      Enter hexadecimal values into memory
fill		f [range][value] Fill memory with a value 	
go		g                Go! Begin execution
quit            q                Quit. Exit debug & Return to DOS
unassemble	u [address]	 Display memory contents as instructions
-------------------------------------------------------------------------

Getting Started

  1. Invoke debug from the DOS command line as C> DEBUG
  2. The debug prompt is '-'
  3. First, clear the memory to be used with the fill command: -f 100 300 00
  4. Remember the Q (quit) command exits debug and returns to DOS.

Note the 8086 instruction INT 20 stops program execution and causes debug to reset the instruction pointer (IP) back to the first instruction. All the programs in these examples must end with INT 20.


Example Exercises

  1. The IEEE 64-bit value for 1
  2. The IEEE 64-bit value for PI
  3. The Square Root of Two
  4. The Square Root of an Arbitrary Integer

27 JAN 98 tervo@unb.ca
University of New Brunswick
Department of Electrical and Computer Engineering