Go to main content

SPARC Assembly Language Reference Manual

Exit Print View

Updated: November 2020
 
 

7.2 Using __asm Statements in C and C++

The Oracle Developer Studio C and C++ compilers support the __ asm statement:

__asm(string);
__asm{
...block of instructions...
}

The string may be a single assembler instruction, or a block of instructions, as in the following examples.

The following __asm statement is supported:

__asm("lzd ccx %o0");

The following block of instructions is supported:

__asm{
  ldd ccx %f0
  ldd ccy %f1
  fadd %f0 %f1 %f0
  st ccz %f0
}

The Oracle Developer Studio C and C++ compilers also support the GCC Extended ASM Statement syntax. See the GCC compiler documentation at gcc.gnu.org for details.