Developer Guide and Reference

Contents

Inline Assembly

Microsoft* Style Inline Assembly

The Intel® C++ Compiler supports Microsoft-style inline assembly on Windows*.
The Intel® C++ Compiler supports Microsoft-style inline assembly on Linux* when used with the
-use-msasm
option
. See the Microsoft documentation for the proper syntax.

GNU*-like Style Inline Assembly (IA-32 architecture and Intel® 64 architecture only)

The Intel® C++ Compiler supports GNU-like style inline assembly. The syntax is as follows:
asm-keyword [ volatile-keyword ] ( asm-template [ asm-interface ] ) ;
The Intel® C++ Compiler also supports mixing UNIX* and Microsoft* style asms. Use the
__asm__
keyword for GNU-style ASM when using the
-use_msasm
switch.
The Intel® C++ Compiler supports gcc-style inline ASM if the assembler code uses AT&T* System V/386 syntax.
Syntax Element
Description
asm-keyword
Assembly statements begin with the keyword
asm
. Alternatively, either
__asm
or
__asm__
may be used for compatibility. When mixing UNIX* and Microsoft* style asm, use the
__asm__
keyword.
The compiler only accepts the
__asm__
keyword. The
asm
and
__asm
keywords are reserved for Microsoft* style assembly statements.
volatile-keyword
If the optional keyword
volatile
is given, the
asm
is volatile. Two volatile
asm
statements are never moved past each other, and a reference to a volatile variable is not moved relative to a volatile
asm
. Alternate keywords