|Non-Confidential||PDF version||ARM DUI0471M|
|Home > Interworking ARM and Thumb > Assembly language interworking|
There are several assembly language instructions that can cause a change between ARM and Thumb state.
--apcs=/interwork command-line option enables
the ARM assembler to assemble code that can be called from another
instruction set state:
armasm --thumb --apcs=/interwork armasm --arm --apcs=/interwork
In an assembly language source file, you can have several areas. These correspond to ARM Executable and Linkable Format (ELF) sections. Each area can contain ARM instructions, Thumb instructions, or both.
You can use the linker to fix up calls to routines that use a different instruction set
from the caller. To do this, use
BL to call the routine.
If you prefer, you can write your code to make the instruction
set changes explicitly. In some circumstances you can write smaller
or faster code by doing this. You can use
to perform the instruction set state changes.
The ARM assembler can assemble both Thumb code and ARM code.
By default, it assembles ARM code unless it is invoked with the
THUMB directives instruct the assembler to
assemble instructions from the appropriate instruction set.