KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q32777: Language Names Used as PUBLIC Symbols Are Not Allowed

Article: Q32777
Product(s): Microsoft Macro Assembler
Version(s): 5.1,5.1a
Operating System(s): 
Keyword(s): 
Last Modified: 06-MAY-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Macro Assembler (MASM), versions 5.1, 5.1a 
-------------------------------------------------------------------------------

SUMMARY
=======

Starting with the Microsoft Macro Assembler (MASM) version 5.1, symbols that are
language names cannot be declared PUBLIC. The language names affected are Basic,
C, FORTRAN, and PASCAL. The following error message is displayed by MASM 5.1 and
5.1a

  error A2009: Symbol not defined:

Note that it does not name the offending label.

The following error is the generated by MASM 6.0

  error A2008: Syntax error in directive

MORE INFORMATION
================

The use of language names as variables is allowed in MASM versions 5.1 and 5.1a,
but not is MASM 6.0. MASM 6.0 will give the error

  error A2008: syntax error: <language name>

where <language name> is Basic, C, FORTRAN, or PASCAL.

The following example will cause MASM 5.1 and 5.1a to correctly generate error
A2009 on the line

     public c

and MASM 6.0 to correctly generate error A2008 on the following lines

     public c
     c  DB  1

Sample Code
-----------

  ; Assemble options needed: none

  .model small
  .data
  public c

  c  DB  1

     END

Additional query words: kbinf 5.10 5.10a

======================================================================
Keywords          :  
Technology        : kbMASMsearch kbAudDeveloper kbMASM510 kbMASM510a
Version           : :5.1,5.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.