KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q40103: QuickC 2.00’s In-Line Assembler

Article: Q40103
Product(s): See article
Version(s): 2.00
Operating System(s): MS-DOS
Keyword(s): enduser | | mspl13_c
Last Modified: 17-JAN-1989

QuickC Version 2.00 has the ability to handle assembly-language
instructions in your C program. This feature is built into QuickC
Version 2.00 and does not require an external assembler program.

In-line assembly instructions can appear at any place that a valid
C statement can reside. The following is an example using in-line
assembly:

    void main ()
    {
      .   ( C Code )
      .
      _asm {
             mov    ah, 5
             mov    al, 1
             int    10h
           }
      .
      .
    }

The _asm designates the code that follows as assembly. QuickC uses its
In-Line Assembler instead of the compiler. The _asm keyword can be
applied to individual assembly statements and blocks of assembly code.
As in the above example, the block of assembly code is delimited by
the {} braces. If you have only one assembly statement, the {} braces
are not required.

If you want to place more than one assembly instruction on a single
line, place the _asm before each instruction, as in the following code
fragment:

    _asm    mov  ah, 5   _asm   mov  al, 1    _asm  int 10h

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.