6.29 Restrictions on embedded assembly language functions in C and C++ code
A number of restrictions apply to embedded assembly language functions.
__asm functions can only contain assembly code,
with the exception of the following embedded assembler built-ins:
No return instructions are generated by the compiler for an
function. If you want to return from an
__asm function, you must
include the return instructions, in assembly code, in the body of the function.
This makes it possible to fall through to the next function, because the embedded
assembler guarantees to emit the
__asm functions in the order you
define them. However, inlined and template functions behave differently. Do not assume
that code execution falls out of an inline or template function into another embedded
__asm functions do not change the ARM
Architecture Procedure Call Standard (AAPCS) rules that apply. This means that
all calls between an
__asm function and a normal C or C++ function must
adhere to the AAPCS, even though there are no restrictions on the assembly code that an
__asm function can use (for example, change state).