Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  The 8086, 80286, and 80386 can work only with integers. To perform
  floating-point computations on an 8086-family microprocessor, you must
  represent floating-point values in memory and manipulate them using only
  integer operations. During compilation, the language translator represents
  each floating-point computation as a long, slow series of integer
  operations. Thus, "number-crunching" programs can run very slowly--a
  problem if you have a large number of calculations to perform.

  A good solution to this problem is to use a separate math coprocessor that
  performs floating-point calculations. Each of the 8086-family
  microprocessors has an accompanying math coprocessor: The 8087 math
  coprocessor is used with an 8086 or 8088; the 80287 math coprocessor is
  used with an 80286; and the 80387 math coprocessor is used with an 80386.
  (See Figure 1-5.) Each PC and PS/2 is built with an empty socket on its
  motherboard into which you can plug a math coprocessor chip.

  From a programmer's point of view, the 8087, 80287, and 80387 math
  coprocessors are fundamentally the same: They all perform arithmetic with
  a higher degree of precision and with much greater speed than is usually
  achieved with integer software emulation. In particular, programs that use
  math coprocessors to perform trigonometric and logarithmic operations can
  run up to 10 times faster than their counterparts that use integer
  emulation.

  Programming these math coprocessors in assembly language can be an
  exacting process. Most programmers rely on high-level language translators
  or commercial subroutine libraries when they write programs to run with
  the math coprocessors. The techniques of programming the math coprocessors
  directly are too specialized to cover in this book.


                          Approximate Range                                Significant Digits
  Data Type            (from)               (to)                 Bits      (decimal)
  ----------------------------------------------------------------------------------------------
  Word integer         -32,768              +32,767              16            4
  Short integer        -2 x 10E9            +2 x 10E9            32            9
  Long integer         -9 x 10E18           +9 x 10E18           64           18
  Packed decimal       -99...99             +99...99             80           18
  Short real           8.43 x 10E-37        3.37 x 10E38         32          6-7
  Long real            4.19 x 10E-307       1.67 x 10E308        64        15-16
  Temporary real       3.4 x 10E-4932       1.2 x 10E4932        80           19
  ----------------------------------------------------------------------------------------------


  Figure 1-5.  The range of numeric data types supported by the 8087,
  80287, and 80387 math coprocessors.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson