4.3. Differences between inline and embedded assembly code

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

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

Table 4.1. Differences between inline and embedded assembler

FeatureEmbedded assemblerInline assembler
Instruction setARM and ThumbARM only
ARM assembler directivesAll supportedNone supported
C/C++ expressionsConstant expressions onlyFull C/C++ expressions
Optimization of assembly codeNo optimizationFull optimization
InliningNeverPossible
Register accessSpecified physical registers are used. You can also use PC, LR and SP.Uses virtual registers (see Virtual registers)
Return instructionsYou must add them in your code.Generated automatically

Note

A list of differences between embedded assembler and C or C++ is provided in Differences between expressions in embedded assembler and C or C++.

Copyright © 2003, 2004 ARM Limited. All rights reserved.ARM DUI 0232B
Non-Confidential