Real-Number Encoding Needs Exact Number of Digits

Last reviewed: January 23, 1995
Article ID: Q35507
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, versions 5.1, 5.1a, 6.0, 6.0a, and 6.0b
  • Microsoft Macro Assembler for OS/2, versions 5.1, 5.1a, 6.0, 6.0a, and 6.0b

SUMMARY

In the Microsoft Macro Assembler (MASM) versions 5.1, 5.1a, 6.0, 6.0a, and 6.0b real numbers can be initialized with a hexadecimal encoding by using the DD, DQ, and DT directives. In MASM 6.0, 6.0a, and 6.0b real numbers can also be initialized with a hexadecinal encoding by using the REAL4, REAL8, and REAL10 directives. The number of digits for encoded numbers declared with DD, DQ, and DT or REAL4, REAL8, and REAL16 must be 8, 16, and 20 digits, respectively. If a leading 0 is supplied, the number must be 9, 17, and 21 digits respectively.

MORE INFORMATION

The following example generates the warning:

   warning A4057: Illegal size for operand

   _DATA SEGMENT 'DATA'
   a_var DQ 000000000r
   _DATA ENDS
   END

MASM will correctly evaluate the constant, but the warning is telling the user that the number of digits is not correct. The real number should be defined with exactly 17 digits as in the following example.

   _DATA SEGMENT 'DATA'
   a_var DQ 00000000000000000r
   _DATA ENDS
   END


Additional reference words: kbinf 5.10 5.10a 6.00 6.00a 6.00b
KBCategory: kbtool
KBSubCategory: MLIss


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 23, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.