Higher-level languages such as C and C++ run on nearly all architectures and yield higher productivity when writing and maintaining code.
GNU Compiler Collection permits programmers to add architecture-dependent assembly language instructions to their programs. For example, programs using x86 instructions cannot be compiled on Power PC computers.
Inline assembly statements permit you to access hardware directly and can also yield faster code.
An asm instruction allows you to insert assembly instructions into C and C++ programs. For example, this instruction
asm ("fsin" :"=t" (answer) : "0" (angle));
is an x86-specific way of coding this C statement:
answer = sin (angle);
The expression sin (angle) is usually implemented as a function call into the math library, but if you specify the or higher optimization flag, GCC is smart enough to replace the function call with a single fsin assembly instruction.