| |||
| Home > Assembler > Directives > CODE32 directive | |||
The CODE32 directive instructs the assembler
to interpret subsequent instructions as 32-bit ARM instructions.
Use CODE32 to when branching to ARMstate from
Thumb state. CODE32 precedes code at the destination
of the branch.
The assembler inserts up to three bytes of padding, if necessary,
to bring following ARM code into word alignment. CODE32 does
not assemble to an instruction that changes the mode. It only instructs
the assembler to assemble ARM instructions.
See also CODE16 directive.
CODE16 ; Start this area in Thumb state AREA ThumbEx, CODE, READONLY MOV r1,#10 ; Thumb instructions ADR r0,goarm ; Load the address and leave the ; least significant bit clear. BX r0 ; Branch and exchange instruction ; sets ; Not necessarily in the same area CODE32 ; Following instructions are ARM goarm MOV r4,#15 ; ARM instructions