PRB: Span-Dependent Value Behavior Changes in N-Pass Assembly (80384)
The information in this article applies to:
- Microsoft Macro Assembler (MASM) 6.0
- Microsoft Macro Assembler (MASM) 6.0a
- Microsoft Macro Assembler (MASM) 6.0b
- Microsoft Macro Assembler (MASM) 6.1
- Microsoft Macro Assembler (MASM) 6.1a
- Microsoft Macro Assembler (MASM) 6.11
This article was previously published under Q80384 SYMPTOMS
When the Microsoft Macro Assembler (MASM) assembles code that depends
on the difference between the values of two labels (a span-dependent
value), the results of an assembly by MASM versions 6.0 or later
differs from the results produces by an earlier version of MASM.
Specifically, the difference occurs when the application uses a span-
dependent value in one of the following cases:
- In the expression for a preprocessor directive, like IF
- In the expression for a predefined macro, like REPEAT or WHILE
- In the arguments to a MACRO or TEXTEQU statement preceded by %
(percent sign)
CAUSE
MASM versions 5.1 and earlier are two-pass assemblers; MASM versions
6.0 and later are N-pass assemblers.
RESOLUTION
Avoid using a span-dependent value in a preprocessor directive or in a
predefined macro. If the code requires a span-dependent value, create
and review a listing file to determine that each span-dependent value
is evaluated as desired.
Avoid using the % operator with span-dependent values. The assembler
evaluates an expression containing the % operator on the first pass.
In many cases, the assembler produces the desired results when you
remove the % operator and delay expression evaluation to a later pass.
STATUS
This behavior is under review and may or may not change in a future
release.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | KB80384 |
---|
|