Differences in compiler support of inline and embedded assembly code

There are differences between the way inline and embedded assembly is compiled:

Table 22 summarizes the main differences between inline assembler and embedded assembler.

Table 22. Differences between inline and embedded assembler

FeatureEmbedded assemblerInline assembler
Instruction setARM and Thumb.ARM only.
ARM assembler directivesAll supported.None supported.
ARMv6 instructionsAll supported.

Supports most instructions, with some exceptions, for example SETEND and some of the system extensions. The complete set of ARMv6 SIMD instructions is supported.

ARMv7 instructionsAll supported.Not supported.
C/C++ expressionsConstant expressions only.Full C/C++ expressions.
Optimization of assembly codeNo optimization.Full optimization.
InliningNever.Possible.
Register accessSpecified physical registers are used. You can also use PC, LR and SP.

Uses virtual registers. Using sp (r13), lr (r14), and pc (r15) gives an error.

Return instructionsYou must add them in your code.Generated automatically. (The BX , BXJ, and BLX instructions are not supported.)
BKPT instructionSupported directly.Not supported.

Show/hideSee also

Copyright © 2010-2011 ARM. All rights reserved.ARM DUI 0472E
Non-ConfidentialID071611