Keil Logo

Changing between ARM, Thumb, and ThumbEE state

2.3 Changing between ARM, Thumb, and ThumbEE state

The processor must be in the correct instruction set state for the instructions it is executing.

A processor that is executing ARM instructions is operating in ARM state. A processor that is executing Thumb instructions is operating in Thumb state. A processor that is executing ThumbEE instructions is operating in ThumbEE state. A processor can also operate in another state called the Jazelle® state. These are called instruction set states. The assembler cannot directly assemble code for the Jazelle state.
A processor in one instruction set state cannot execute instructions from another instruction set. For example, a processor in ARM state cannot execute Thumb instructions, and a processor in Thumb state cannot execute ARM instructions. You must ensure that the processor never receives instructions of the wrong instruction set for the current state.
The initial state after reset depends on the processor being used and its configuration.
To direct the assembler to generate ARM or Thumb instruction encodings, you must set the assembler mode using an ARM or THUMB directive. To generate ThumbEE code, use the THUMBX directive. Assembly code using CODE32 and CODE16 directives can still be assembled, but ARM recommends using ARM and THUMB for new code.
These directives do not change the instruction set state of the processor. To do this, you must use an appropriate instruction, for example BX or BLX to change between ARM and Thumb states when performing a branch.
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.