Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - the chapters entitled 16-bit pragmas and 32-bit pragmas briefly describe the http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The chapters entitled 16-bit Pragmas and 32-bit Pragmas briefly describe the
use of the auxiliary pragma to create a sequence of assembly language
instructions that can be placed anywhere executable C/C++ statements can
appear in your source code.  This chapter is devoted to an in-depth look at
in-line assembly language programming.

The reasons for resorting to in-line assembly code are varied:

 .  Speed - You may be interested in optimizing a heavily-used section of
    code.
 .  Size - You may wish to optimize a module for size by replacing a library
    function call with a direct system call.
 .  Architecture - You may want to access certain features of the Intel x86
    architecture that cannot be done so with C/C++ statements.

There are also some reasons for not resorting to in-line assembly code.

 .  Portability - The code is not portable to different architectures.
 .  Optimization - Sometimes an optimizing compiler can do a better job of
    arranging the instruction stream so that it is optimal for a particular
    processor (such as the 486 or Pentium).

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson