Enables code generation for the selected ARM® processor
name is the name of a
as shown on ARM data
sheets, for example,
Processor names are not case-sensitive.
if you do not specify a
The following general points apply to processor
Selecting the processor selects the
appropriate architecture, Floating-Point Unit (FPU), and memory
If you specify a processor
--cpu option, the generated code is optimized for that
processor. This enables the assembler to use specific coprocessors or
instruction scheduling for optimum performance.
Some specifications of
--cpu imply an
For example, when building
NoteAny explicit FPU, set with
--fpu on the command line, overrides an implicit
--fpu option is specified and no
--cpu option is
--fpu=softvfp is used.
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
--thumb is not required.
NoteSpecifying 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.
You cannot specify both a processor and an architecture on the same command-line.
armasm --cpu=Cortex-A17 inputfile.s