ARM or CODE32 directive
The ARM
directive instructs the assembler to interpret subsequent instructions as A32 instructions, using either the UAL or the pre-UAL ARM assembler language syntax. CODE32
is a synonym for ARM
.
Note
Not supported for AArch64 state.Syntax
ARM
Usage
In files that contain code using different instruction sets, ARM
must precede any A32 code.
If necessary, this directive also inserts up to three bytes of padding to align to the next word boundary.
This directive does not assemble to any instructions. It also does not change the state. It only instructs armasm to assemble A32 instructions as appropriate, and inserts padding if necessary.
Example
This example shows how you can use ARM
and THUMB
directives
to switch state and assemble both A32 and T32 instructions in a
single 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 T32 into_t32 MOVS r0, #10 ; New-style T32 instructions