Q107500: BUG: Invalid A2006 Error Generated by MASM 6.x
Article: Q107500
Product(s): Microsoft Macro Assembler
Version(s): 6.0,6.0a,6.0b,6.1,6.11,6.1a
Operating System(s):
Keyword(s):
Last Modified: 06-MAY-2001
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft Macro Assembler (MASM), versions 6.0, 6.0a, 6.0b, 6.1, 6.1a, 6.11
-------------------------------------------------------------------------------
SYMPTOMS
========
When you attempt to assemble the sample code below, the Microsoft Macro
Assembler (MASM) fails and reports the following error for the two lines with
"mov" instructions:
error A2006: undefined symbol
RESOLUTION
==========
To work around the problem, do one of the following,
- Simplify the expression. If you uncomment the lines in the sample code, and
delete the original instructions, the code will assemble without errors.
-or- - Assemble with the /Zm option (or run MASM.EXE instead of ML.EXE).
-or-
- Use the OPTION OLDSTRUCTS directive to have the assembler treat structure
members the same as in MASM 5.1.
STATUS
======
Microsoft has confirmed this to be a problem in MASM versions 6.0x, 6.1, 6.1a,
and 6.11. We are researching this problem and will post new information here in
the Microsoft Knowledge Base as it becomes available.
Sample Code
-----------
; Assemble options needed: none
.MODEL small
STEST STRUCT
f1 BYTE ?
f2 BYTE ?
STEST ENDS
.CODE
mov al, SIZEOF STEST.f1 + SIZEOF STEST.f2
mov al, LENGTHOF STEST.f1 + LENGTHOF STEST.f2
;
; Uncomment the lines below and delete the two lines above to avoid
; the A2006 error
;
; temp = SIZEOF STEST.f1
; mov al, temp + SIZEOF STEST.f2
; temp = LENGTHOF STEST.f1
; mov al, temp + LENGTHOF STEST.f2
END
Additional query words: buglist6.00 buglist6.00a 6.00 6.00a 6.00b 6.10 6.10a 6.11 buglist6.00b buglist6.10 buglist6.10a buglist6.11
======================================================================
Keywords :
Technology : kbMASMsearch kbAudDeveloper kbMASM600 kbMASM610 kbMASM611 kbMASM610a kbMASM600a kbMASM600b
Version : :6.0,6.0a,6.0b,6.1,6.11,6.1a
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.