Keil Logo

Technical Support

On-Line Manuals

Assembler User Guide

Preface Overview of the Assembler Overview of the ARM Architecture Structure of Assembly Language Modules Writing ARM Assembly Language Condition Codes Using the Assembler Symbols, Literals, Expressions, and Operators VFP Programming Assembler Command-line Options --16 --32 --apcs=qualifier…qualifier --arm --arm_only --bi --bigend --brief_diagnostics, --no_brief_diagnostics --checkreglist --comment_section, --no_comment_section --compatible=name --cpreproc --cpreproc_opts=option[,option,…] --cpu=list --cpu=name --debug --depend=dependfile --depend_format=string --diag_error=tag[,tag,…] --diag_remark=tag[,tag,…] --diag_style={arm|ide|gnu} --diag_suppress=tag[,tag,…] --diag_warning=tag[,tag,…] --dllexport_all --dwarf2 --dwarf3 --errors=errorfile --execstack, --no_execstack --execute_only --exceptions, --no_exceptions --exceptions_unwind, --no_exceptions_unwind --fpmode=model --fpu=list --fpu=name -g --help -idir[,dir, …] --keep --length=n --li --library_type=lib --liclinger=seconds --list=file --list= --littleend -m --maxcache=n --md --no_code_gen --no_esc --no_hide_all --no_regs --no_terse --no_warn -o filename --pd --predefine "directive" --reduce_paths, --no_reduce_paths --regnames --report-if-not-wysiwyg --show_cmdline --split_ldm --thumb --thumbx --unaligned_access, --no_unaligned_access --unsafe --untyped_local_labels --version_number --via=filename --vsn --width=n --xref ARM and Thumb Instructions VFP Instructions Directives Reference Via File Syntax

--cpu=name

9.15 --cpu=name

Enables code generation for the selected ARM® processor

Syntax

--cpu=name
Where name is the name of a processor. Enter name as shown on ARM data sheets, for example, Cortex-M3.
Processor names are not case-sensitive.

Default

armasm assumes --cpu=ARM7TDMI if you do not specify a --cpu option.

Usage

The following general points apply to processor options:
Processors
  • Selecting the processor selects the appropriate architecture, Floating-Point Unit (FPU), and memory organization.
  • If you specify a processor for the --cpu option, the generated code is optimized for that processor. This enables the assembler to use specific coprocessors or instruction scheduling for optimum performance.
FPU
  • Some specifications of --cpu imply an --fpu selection.
    For example, when building with the --arm option, --cpu=Cortex-R4F implies --fpu=vfpv3_d16.

    Note

    Any explicit FPU, set with --fpu on the command line, overrides an implicit FPU.
  • If no --fpu option is specified and no --cpu option is specified, --fpu=softvfp is used.
ARM/Thumb
  • Specifying a processor or architecture that supports Thumb instructions, such as --cpu=ARM7TDMI, does not make the assembler generate Thumb code. It only enables features of the processor to be used, such as long multiply. Use the --thumb option to generate Thumb code, unless the processor is a Thumb-only processor, for example Cortex-M4. In this case, --thumb is not required.

    Note

    Specifying the target processor or architecture might make the generated object code incompatible with other ARM processors. For example, code generated for architecture ARMv6 might not run on an ARM920T processor, if the generated object code includes instructions specific to ARMv6. Therefore, you must choose the lowest common denominator processor suited to your purpose.
  • If you are building for mixed ARM/Thumb systems for processors that support ARMv4T or ARMv5T, then you must specify the interworking option --apcs=/interwork. By default, this is enabled for processors that support ARMv5T or above.
  • If you build for Thumb, that is with the --thumb option on the command line, the assembler generates as much of the code as possible using the Thumb instruction set. However, the assembler might generate ARM code for some parts of the compilation. For example, if you are generating code for a 16-bit Thumb processor and using VFP, any function containing floating-point operations is compiled for ARM.

Restrictions

You cannot specify both a processor and an architecture on the same command-line.

Example

armasm --cpu=Cortex-A17 inputfile.s
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.