4.2.2. Changing the assembler mode

The ARM assembler can assemble both Thumb code and ARM code. By default, it assembles ARM code unless it is invoked with the --thumb option.

Because all ARM processors that support Thumb start in ARM state, you must use the BX instruction to branch and exchange to Thumb state, and then use the following assembler directives to instruct the assembler to switch assembly mode:

THUMB

Instructs the assembler to assemble the following instructions as Thumb instructions. This also causes an alignment to a two-byte boundary, even if no instructions follow it.

ARM

Instructs the assembler to return to assembling ARM instructions. This also causes an alignment to a four-byte boundary, even if no instructions follow it.

See RealView Compilation Tools v3.0 Assembler Guide for more information on these directives.

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