Summary: The assembler stores real numbers in the IEEE format.
The assembler stores the floating-point variables in the IEEE format. MASM 6.0 does not support .MSFLOAT and Microsoft binary format, which are available in previous versions.
Figure 6.1 illustrates the IEEE format for encoding short (four-byte), long (eight-byte), and 10-byte real numbers. Although this figure places the most-significant bit first for illustration, low bytes actually appear first in memory.
This is how the parts of a real number are stored in the IEEE format:
1.Sign bit (0 for positive or 1 for negative) in the upper bit of the first byte.
2.Exponent in the next bits in sequence (8 bits for a short real number, 11 bits for a long real number, and 15 bits for a 10-byte real number).
3.Mantissa in the remaining bits. The first bit is always assumed to be 1. The length is 23 bits for short real numbers, 52 bits for long real numbers, and 63 bits for 10-byte reals.
The exponent field represents a multiplier 2n. To accommodate negative exponents (such as 2-6), the value in the exponent field is biased; that is, the actual exponent is determined by subtracting the appropriate bias value from the value in the exponent field. For example, the bias for short reals is 127. If the value in the exponent field is 130, the exponent represents a value of 2130-127, or 23. The bias for long reals is 1,023. The bias for 10-byte reals is 16,383.
Notice that the 10-byte real format stores the integer part of the mantissa. This differs from the 4-byte and 8-byte formats, in which the integer part is implicit.
Once you have declared floating-point data for your program, you can use coprocessor or emulator instructions to access the data. The next section focuses on the coprocessor architecture, instructions, and operands required for floating-point operations.