21.65 THUMB directive
THUMB directive instructs the assembler to interpret subsequent instructions as T32 instructions, using the UAL syntax.
NoteNot supported for AArch64 state.
In files that contain code using different instruction sets,
THUMB must precede T32 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 armasm to assemble T32 instructions as appropriate, and inserts padding if necessary.
This example shows how you can use
THUMB directivesto switch state and assemble both A32 and T32 instructions in asingle area.
AREA ToT32, CODE, READONLY ; Name this block of code ENTRY ; Mark first instruction to execute ARM ; Subsequent instructions are A32 start ADR r0, into_t32 + 1 ; Processor starts in A32 state BX r0 ; Inline switch to T32 state THUMB ; Subsequent instructions are T32into_t32 MOVS r0, #10 ; New-style T32 instructions