C Language and Libraries Help (clang.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
__asm
                                             Up Contents Index Back
─────C/C++ Language─────────────────────────────────────────────────────────
 
  Keyword:   __asm
 
  Syntax:    __asm assembly language instruction
             __asm
             {
                assembly language instructions
             }
 
  Summary:   If used without braces, the __asm keyword means that the
             rest of the line is an assembly-language statement. If used
             with braces, it means that each line between the braces is
             an assembly-language statement. For compatibility with
             previous versions, _asm is a synonym for __asm.
 
             NOTE: Microsoft C++ does not support the AT&T C++ asm
                   keyword.
 
             See:  Statement Format
                   Using C Symbols with the Inline Assembler
                   Defining __asm Blocks as C Macros
                   Preserving Registers with the Inline Assembler
                   Assembly Language Operators and Directives
                   The Inline Assembler and Compiler Options
 
  See also:  __emit
 
     The language recognized by the inline assembler is a subset of
     that recognized by the Microsoft Macro Assembler (MASM). The
     default instruction set is the 8086/8087, or the 80286/80287 if
     the /G2 option is given.
 
     The following MASM concepts are not recognized by the inline
     assembler:
 
        ■ Data directives and operators (DB, DW, DUP, RECORD, STRUCT,
          etc.)
 
        ■ Macros, equates, and related directives and operators
 
        ■ Segment directives and names
 
        ■ Calls and jumps to far labels
 
     An __asm block can use the following C-language elements:
 
        ■ Symbols, including labels, variables, and function names
 
        ■ Constants, including symbolic constants and enum members
 
        ■ Macros and preprocessor directives
 
        ■ Type or typedef names wherever a MASM type is legal
 
        ■ C comments (starting with // or enclosed in /* */)
 
        ■ C constants (0xff is the same as 0FFh)
                                    -♦-