F.2. GCC Compiler for Linux

Many C compilers support an intrinsic function asm(...) to provide a general means of inserting native machine instructions directly into a program through inline assembly.

The syntax of the asm function uses a very general text-substitution scheme into which the requirements for many assembly languages can be accommodated:

asm volatile ( "pattern for machine instruction(s)"
: list of outputs
: list of inputs
: list of indirectly modified items );

where volatile is optional but may inhibit some compilers from deleting, moving appreciably, or combining the machine instructions; where instructions can be separated with \n\t; and where __asm__ is an alternate keyword for ISO C compatibility.

Output or input parameters ...

Get Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.