Miscellaneous inline assembler restrictions
in C and C++ code
Compared with armasm or embedded assembly
language, the inline assembler has the following restrictions:
The inline assembler is a high-level assembler,
and the code it generates might not always be exactly what you write.
Do not use it to generate more efficient code than the compiler generates.
Use embedded assembler or the ARM assembler armasm for
this purpose.
Some low-level features that are available in the
ARM assembler armasm, such as writing to PC,
are not supported.
Label expressions are not supported.
You cannot get the address of the current instruction
using dot notation (.) or {PC}.
The & operator cannot be
used to denote hexadecimal constants. Use the 0x prefix
instead. For example:
__asm { AND x, y, 0xF00 }
The notation to specify the actual rotation of an
8-bit constant is not available in inline assembly language. This
means that where an 8-bit shifted constant is used, the C flag must
be regarded as corrupted if the NZCV flags are updated.
You must not modify the stack pointer. This is not
necessary because the compiler automatically stacks and restores
any working registers as required. The compiler does not permit
you to explicitly stack and restore work registers.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.