Microsoft KB Archive/35507

From BetaArchive Wiki
Knowledge Base

Real-Number Encoding Needs Exact Number of Digits

Article ID: 35507

Article Last Modified on 10/17/2003


  • Microsoft Macro Assembler 5.1 Standard Edition
  • Microsoft Macro Assembler 5.1a
  • Microsoft Macro Assembler 6.0 Standard Edition
  • Microsoft Macro Assembler 6.0a
  • Microsoft Macro Assembler 6.0b

This article was previously published under Q35507


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.


The following example generates the warning:

warning A4057: Illegal size for operand
a_var DQ 000000000r

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.

   a_var DQ 00000000000000000r

Additional query words: kbinf 5.10 5.10a 6.00 6.00a 6.00b

Keywords: KB35507