Effect of compiler ARM and Thumb states
on embedded assembler
The initial state of the embedded assembler, ARM or Thumb
state, is determined by the initial state of the compiler, as specified
on the command line. This means that:
if the compiler starts in ARM state, the embedded
assembler uses --arm
if the compiler starts in Thumb state, the embedded
assembler uses --thumb.
The embedded assembler state at the start of each function
is as set by the invocation of the compiler, as modified by #pragma
arm and #pragma thumb pragmas.
You can change the state of the embedded assembler within
a function by using explicit ARM, THUMB,
or CODE16 directives in the embedded assembler function.
Such a directive within an __asm function does
not affect the ARM or Thumb state of subsequent __asm functions.
If you are compiling for a 32-bit Thumb capable processor,
you can use 32-bit Thumb instructions when in Thumb state.
This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.
ARM websites use two types of cookie: (1) those that enable the site to function and perform as required; and (2) analytical cookies which anonymously track visitors only while using the site. If you are not happy with this use of these cookies please review our Privacy Policy to learn how they can be disabled. By disabling cookies some features of the site will not work.