The information in this article applies to:
SYMPTOMSThe comparison of a constant and a relocatable is not allowed. The following example demonstrates three approaches to comparing a constant and a relocatable. In the Microsoft Macro Assembler (MASM) 5.1 and 5.1a you will get the warning: on the first of these approaches. In MASM 6.0, 6.0a, and 6.0b you will get the error: on the first of these approaches, and you will get the error: on the second. The third approach, which turns the relocatable into a constant by subtracting the beginning of the segment, will work. CAUSEYou can not compare a constant to a relocatable at assembly time because the linker may change the value of the relocatable at link time. RESOLUTIONThis is the expected behavior of MASM. The third approach in the example below demonstrates the prefered way to compare a constant and a relocatable. MORE INFORMATIONSample Code
Additional query words: 5.10 5.10a 6.00 6.00a 6.00b
Keywords : |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |