Keil Logo

ARM or CODE32

12.7 ARM or CODE32

The ARM directive instructs the assembler to interpret subsequent instructions as ARM instructions, using either the UAL or the pre-UAL ARM assembly language syntax. CODE32 is a synonym for ARM.

Syntax

ARM

Usage

In files that contain code using different instruction sets, ARM must precede any ARM 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 the assembler to assemble ARM 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 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.