The information in this article applies to:
SYMPTOMSThe Microsoft Macro Assembler (MASM) versions 5.1 and 5.1a incorrectly allow relative expressions to be used as constant expressions if the relative expression is used inside an IF1 directive. Instead of generating an error, the assembler uses the current value of the relative expression as a constant expression. STATUSMicrosoft has confirmed this to be a problem in MASM versions 5.1 and 5.1a. This problem was corrected in MASM version 6.0. MORE INFORMATION
A constant expression is a numeric expression that can be resolved at
assembly time. A relative expression is a expression that cannot be
resolved at assembly time and must be resolved at link time. Relative
expressions include all data and code labels, including the current
location counter, $. Anything that generates a fixup record is a
relative expression.
Converting MASM 5.1 programs to MASM 6.0 programs that rely on this problem in MASM 5.1 may be difficult. The difference between two relative expressions is a constant expression, and this may be used to replace the single relative expression. The sample code below demonstrates this workaround. This solution may not be valid in all instances. Since MASM 6.0 evaluates these types of expressions on the first pass only, the constant value may not be what was expected if subsequent passes change the values of the relative expressions. In MASM 6.0, the IF1 directive is always considered true. The IF2 directive is no longer supported in MASM 6.0. Sample Code
Additional query words: 5.10 5.10a 6.00 buglist5.10 buglist5.10a fixlist6.00
Keywords : |
Last Reviewed: January 4, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |