-fasm (-qasm)
Category
Pragma equivalent
None.
Purpose
Controls the interpretation and subsequent generation of code for assembler language extensions.
When -qasm is in effect, the compiler generates code for assembly statements in the source code. Suboptions specify the syntax used to interpret the content of the assembly statement.
Note: The system assembler program
must be available for this command to take effect.
Syntax
.-asm----. >>- -f--+-no-asm-+---------------------------------------------><
.-asm--+------------+-. | | .-gcc-. | | | '-=--+-----+-' | >>- -q--+-noasm---------------+--------------------------------><
Defaults
-qasm=gcc or -fasm
Parameters
- gcc
- Instructs the compiler to recognize the extended GCC syntax and semantics for assembly statements.
Specifying -qasm without a suboption is equivalent to specifying the default.
Usage
At language levels stdc89 and stdc99, token asm is not a keyword. At all the other language levels, token asm is treated as a keyword.
The tokens asm, __asm, and __asm__ are keywords at all language levels.
For detailed information about the syntax and semantics of inline asm statements, see Inline assembly statements.
Examples
The following code snippet
shows an example of the GCC conventions for asm syntax
in inline statements:
int a, b, c;
int main() {
asm("add %0, %1, %2" : "=r"(a) : "r"(b), "r"(c) );
}