The information in this article applies to:
SUMMARYThe Microsoft Macro Assembler does not support using the minus operator (-) to negate a relative address, as in the following statement:
Under MASM 5.1 and 5.1a, the error generated for this statement is:
Under MASM 6.0, the error generated is:
MORE INFORMATION
Relocatable means not having an absolute address. Relocatables are
often referred to as "relative addresses." The assembler does not know
where the label, data, or code will be located in memory. The linker
provides the address.
(where Table1 and Table are in the same segment) includes a difference
of relocatables and will be an immediate value. The assembler will
perform the computation. This is one of the recommendations in the
A2040 error shown in the summary.
A statement like such as the following
is equivalent to lea ax, Table[bx]. The offset of Table is known by
the assembler, stored in a data record, fixed up, and added to bx at
run time.
In the following statement introduced in the summary
the offset of Table is known, but the negation of an address is not
defined for any language. The assembler could merely toggle the bits,
but how would the linker interpret the new, negated address and
perform the fixup? What would happen at run time? As it stands, the
value produced would have no meaning. Since this fixup is not
supported, an error is generated.
Additional query words: kbinf 5.00 5.10 5.10a 6.00 6.00a 6.00b
Keywords : |
Last Reviewed: January 4, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |