15.65 THUMB

The THUMB directive instructs the assembler to interpret subsequent instructions as Thumb instructions, using the UAL syntax.

Syntax

THUMB

Usage

In files that contain code using different instruction sets, THUMB must precede Thumb code written in UAL syntax.

If necessary, this directive also inserts one byte of padding to align to the next halfword boundary.

This directive does not assemble to any instructions. It also does not change the state. It only instructs the assembler to assemble Thumb instructions, and inserts padding if necessary.

ARM and THUMB directives

This example shows how you can use ARM and THUMB directives to switch state and assemble both ARM and Thumb instructions in a single area.

     AREA ToThumb, CODE, READONLY  ; Name this block of code
     ENTRY                         ; Mark first instruction to execute
     ARM                           ; Subsequent instructions are ARM 
start
     ADR     r0, into_thumb + 1    ; Processor starts in ARM state 
     BX      r0                    ; Inline switch to Thumb state
     THUMB                         ; Subsequent instructions are Thumb
into_thumb
     MOVS    r0, #10               ; New-style Thumb instructions
Non-ConfidentialPDF file icon PDF versionARM DUI0473M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.