MASM requires different techniques for handling floating-point (real) numbers and binary coded decimal (BCD) numbers than for handling integers. You have two choices for working with real numbers—a math coprocessor or emulation routines.
Math coprocessors—the 8087, 80287, and 80387 chips—work with the main processor to handle real-number calculations. The 80486 processor performs floating-point operations directly. All information in this chapter pertaining to the 80387 coprocessor applies to the 80486 processor as well.
This chapter begins with a summary of the directives and formats of floating-point data; you need to use these to allocate memory storage and initialize variables before you can work with floating-point numbers.
The chapter then explains how to use a math coprocessor for floating-point operations. It covers these areas:
The architecture of the registers
The operands for the coprocessor instruction formats
The coordination of coprocessor and main processor memory access
The basic groups of coprocessor instructions—for loading and storing data, doing arithmetic calculations, and controlling program flow
The next main section describes emulation libraries. With the emulation routines provided with all Microsoft high-level languages, you can use coprocessor instructions as though your computer had a math coprocessor. However, some coprocessor instructions are not handled by emulation, as this section explains.
Finally, because math coprocessor and emulation routines can also operate on BCD numbers, this chapter discusses the instruction set for these numbers.