KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q47027: C2065: ‘_asm’: Undefined

Article: Q47027
Product(s): See article
Version(s): 2.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | | mspl13_c
Last Modified: 7-NOV-1990

The following error code is generated when compiling in-line assembly
code in QuickC Version 2.00 if the Quick environment's compiler
option is set for ANSI Compatibility instead of MS Extensions:

   C2065: '_asm': undefined

Any code following the "_asm" keyword also generates syntax error
messages.

To set the required compiler option, use the following procedure:

1. Choose Options.Make.

2. Within Customize Build Flags, choose Compiler Flags.

3. Within C Language, choose MS Extensions.

/Ze, Microsoft Extensions, is the default for the command line compiler,
QCL. This can create a situation where compiling with QCL will not
issue any complaints about _asm keywords, but compiling within the
QuickC environment will view _asm as undefined (if ANSI option is
specified instead of MS Extensions).

The following program works as expected when compiled and linked
at the command line with default options, for example:

qcl testasm.c

/* TESTASM.C */

void main (void)
{
  _asm {  mov ax, 5  }
}

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.