Microsoft KB Archive/40452

From BetaArchive Wiki
< Microsoft KB Archive
Revision as of 16:56, 18 July 2020 by 3155ffGd (talk | contribs) (importing KB archive)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Article ID: 40452

Article Last Modified on 10/17/2003



APPLIES TO

  • Microsoft Macro Assembler 5.1 Standard Edition



This article was previously published under Q40452

SYMPTOMS

When using an equate in an ifndef block, the following error is generated

A2006: phase error between passes

CAUSE

On pass 1 if the symbol is not defined, it gets defined. On pass 2 it is defined; therefore, you get a phase error.

STATUS

Microsoft has confirmed this to be a problem in MASM versions 5.0, 5.1, and 5.1a. The problem was corrected in MASM version 6.0.

RESOLUTION

When using the equate, specify a size (with WORD PTR, for example).

MORE INFORMATION

The following sample code demonstrates the problem. In order to work around the problem change

   MOV bx, SAVE
                

to the following

   MOV bx, WORD PTR SAVE
                

Sample Code:

;Assemble options needed: none

ifndef SAVE
   SAVE EQU 1
endif

code SEGMENT
   assume cs:code

   MOV bx, SAVE

endcode:

code ENDS
    END
                


Additional query words: 5.10 buglist5.00 buglist5.10 buglist5.10a fixlist6.00

Keywords: kbfix KB40452