__asm (Windows CE 5.0)
The __asm keyword invokes the inline assembler on the declarations that follow it. __asm may not be used alone. It must be followed by an assembly instruction, a group of instructions enclosed in braces, or an empty pair of braces.
__asm
assembly-language-instruction
__asm
{
assembly-language-instructions
}
If used without braces, the __asm keyword means that the rest of the line is an assembly-language statement.
If used with braces, it means that each line between the braces is an assembly-language statement.
For compatibility with previous versions, _asm is a synonym for __asm.
Because the __asm keyword is a statement separator, you can put assembly instructions on the same line.
Example
// Example of the __asm keyword
__asm // __asm block
{
mov eax, 01h
int 10h
}
__asm mov eax, 01h // Separate __asm lines
__asm int 10h
// Multiple __asm statements on a line
__asm mov eax, 01h __asm int 10h
Remarks
The SH-4 microprocessor treats the __asm keyword as a function call. This imposes certain restrictions on the use of __asm in SH-4 inline assembly. For more information, see Limitations of the __asm Keyword in SH-4 Inline Assembly.
See Also
Microsoft-Specific Modifiers | __declspec
Send Feedback on this topic to the authors