1.3.2. Interworking ARM and Thumb code

If you are writing code for ARM processors that support the Thumb 16-bit instruction set, you can mix ARM and Thumb code as required. If you are writing C or C++ code you must compile with the --apcs /interwork option. The linker detects when an ARM function is called from Thumb state, or a Thumb function is called from ARM state and alters call and return sequences, or inserts interworking veneers to change processor state as necessary.


If you want to use absolute addresses to Thumb functions, see Pointers to functions in Thumb state.

If you are writing assembly language code you must ensure that you comply with the interworking variant of the Procedure Call Standard for the ARM Architecture (AAPCS). There are several ways to change processor state, depending on the target architecture version. See Chapter 4 Interworking ARM and Thumb for more information.

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