5.1.3. Differences between inline and embedded assembly code

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

Table 5.1. Differences between inline and embedded assembler

FeatureEmbedded assemblerInline assembler
Instruction setARM and Thumb.ARM only.
ARM assembler directivesAll supported.None supported.
C/C++ expressionsConstant expressions only.Full C/C++ expressions.
Optimization of assembly codeNo optimization.Full optimization.
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.


A list of differences between embedded assembler and C/ C++ is provided in the chapter on inline and embedded assemblers in RealView Compilation Tools v3.0 Compiler and Libraries Guide.

Copyright © 2002-2006 ARM Limited. All rights reserved.ARM DUI 0203G