Procedures With Arguments Require a Specified Language

Last reviewed: January 23, 1995
Article ID: Q39371
The information in this article applies to:
  • Microsoft Macro Assembler for MS-DOS, versions 5.0, 5.1, 5.1a, 6.0, 6.0a and 6.0b
  • Microsoft Macro Assembler for OS/2, versions 5.1, 5.1a, 6.0, 6.0a, and 6.0b

SUMMARY

A program which uses the .MODEL directive and has a procedure which receives arguments, will not assemble correctly if a language is not specified. Under Microsoft Macro Assembler (MASM) versions 5.0, 5.1, and 5.1a, the language is specified with the .MODEL directive and the following errors will be produced the language is omitted:

   A2022: Operand must be type specifier
   A2009: Symbol not defined: 'symbol'

Under MASM 6.0, 6.0a, and 6.0b, the language can be specified as part of the PROC syntax, with the .MODEL directive, with OPTION LANG, or with switches /Gc or /Gd. The following errors will be produced if the language is not specified

   A2119: language type must be specified
   A2006: undefined symbol: 'symbol'

The "Microsoft Macro Assembler Programmer's Guide" does not indicate that the language parameter is required in this case.

MORE INFORMATION

The language parameter on the .MODEL directive enables the PROC extensions, changes the scope of code labels within procedures, and may affect naming. When the language parameter is left off, the PROC directive will only accept a NEAR or FAR specifier.

The following sample program illustrates the situation:

Sample Code

;Assemble options needed: none

        .model small
;       .model small, c             ; This line will permit assembly.

        .code

myadd   PROC arg1:word, arg2:word

        LES bx, arg1
        LES dx, arg2

        RET
myadd   ENDP

        END


Additional reference words: kbinf 5.00 5.10 5.10a 6.00 6.00a 6.00b
KBCategory: kbprg
KBSubCategory: MASMLngIss


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.

Last reviewed: January 23, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.