| |||
| Home > Assembler Reference > Command syntax | |||
This section relates only to armasm. The
inline assemblers are part of the C and C++ compilers, and have
no command syntax of their own.
The armasm command line is case-insensitive,
except in filenames, and where specified.
Invoke the ARM assembler using this command:
armasm Space[ -16 | Space -32]Space[-apcsSpace[ none | Space [/qualifier[/qualifier[...]]]]]Space [ -gend | Space -bittleend]Space[-liheckceglist]Space[-cpuSpace rcpu]Space[-Space ependSpace{ddependfile} | Space -m | Space -md]Space[-rrorsSpace{eerrorfile}]Space[-fpu name]Space[-g]Space[-elp]Space[-iSpace{hdir}Space[,dir]...]Space[-keep]Space[-listSpace[listingfile]Space[options]]Space[-axmacheSpace{cn}]Space[-memaccess Space attributes]Space[-ache]Space[-nocsc]Space[-noeegs]Space[-norarn]Space[-oSpace{nowfilename}]Space[-repefineSpace{"ddirective}"]Space[-split_ldm]Space[-unsafe]Space[-viaSpace{file}]Space{inputfile}
where:
-16instructs the assembler to interpret instructions
as Thumb instructions. This is equivalent to a CODE16 directive
at the head of the source file.
-32instructs the assembler to interpret instructions as ARM instructions. This is the default.
-apcsnone[/qualifier[/qualifier[...]]]specifies whether you are using the ARM/Thumb Procedure Call Standard (ATPCS). It can also specify some attributes of code sections. See ADS Developer Guide for more information about the ATPCS.
/nonespecifies that does
not use ATPCS. ATPCS registers are not set up. Qualifiers are not
allowed.inputfile
ATPCS qualifiers do not affect the code produced by the assembler.
They are an assertion by the programmer that the code in complies with
a particular variant of ATPCS. They cause attributes to be set in
the object file produced by the assembler. The linker uses these
attributes to check compatibility of files, and to select appropriate
library variants.inputfile
Values for are:qualifier
/interworkspecifies that the code in is
suitable for ARM/Thumb interworking. See ADS Developer Guide for
information on interworking.inputfile
/nointerworkspecifies that the code in is
not suitable for ARM/Thumb interworking. This is the default.inputfile
/ropispecifies
that the content of is
read-only position-independent. The default is inputfile/noropi.
/picis
a synonym for /ropi.
/nopicis
a synonym for /noropi.
/rwpispecifies
that the content of is
read-write position-independent. The default is inputfile/norwpi.
/pidis
a synonym for /rwpi.
/nopidis
a synonym for /norwpi.
/swstackcheckspecifies that the code in carries
out software stack-limit checking.inputfile
/noswstackcheckspecifies that the code in does
not carry out software stack-limit checking. This is the default.inputfile
/swstnaspecifies
that the code in is
compatible both with code which carries out stack-limit checking,
and with code that does not carry out stack-limit checking.inputfile
-bigendinstructs the assembler to assemble code suitable
for a big-endian ARM. The default is -littleend.
-littleendinstructs the assembler to assemble code suitable for a little-endian ARM.
-checkreglistinstructs the assembler to check RLIST, LDM,
and STM register lists to ensure that all registers
are provided in increasing register number order. A warning is given
if registers are not listed in order.
-cpu cpusets the target CPU. Some instructions produce either
errors or warnings if assembled for the wrong target CPU (see also
the -unsafe assembler option). Valid values for are
architecture names such as cpu3, 4T,
or 5TE, or part numbers such as ARM7TDMI®. See ARM
Architecture Reference Manual for information about
the architectures. The default is ARM7TDMI.
-depend dependfileinstructs the assembler to save source file dependency
lists to . These
are suitable for use with make utilities.dependfile
-minstructs
the assembler to write source file dependency lists to stdout.
-mdinstructs
the assembler to write source file dependency lists to inputfile.d.
-errors errorfileinstructs the assembler to output error messages
to .errorfile
-fpu namethis option selects the target floating-point
unit (FPU) architecture. If you specify this option it
overrides any implicit FPU set by the -cpu option. Floating-point
instructions produce either errors or warnings if assembled for
the wrong target FPU.
The assembler sets a build attribute corresponding to in
the object file. The linker determines compatibility between object
files, and selection of libraries, accordingly.name
The assembler sets a build attribute corresponding to in
the object file. The linker determines compatibility between object
files, and selection of libraries, accordingly.name
Valid options are:
noneSelects no floating-point option. This makes your assembled object file compatible with any other object file.
vfpThis
is a synonym for -fpu vfpv1.
vfpv1Selects hardware vector floating-point unit conforming to architecture VFPv1.
vfpv2Selects hardware vector floating-point unit conforming to architecture VFPv2.
fpaSelects hardware Floating Point Accelerator.
softvfp+vfpSelects hardware Vector Floating Point unit.
To armasm, this is identical to -fpu
vfpv1. See the C and C++ Compilers chapter
in ADS Compilers and Libraries Guide for details
of the effect on software library selection at link time.
softvfpSelects
software floating-point library (FPLib) with pure-endian doubles.
This is the default if no -fpu option is specified.
softfpaSelects software floating-point library with mixed-endian doubles.
-ginstructs the assembler to generate DWARF2 debug tables. For backwards compatibility, the following command line option is permitted, but not required:
-dwarf2-helpinstructs the assembler to display a summary of the assembler command-line options.
-idir,diradds directories to the source file search path
so that arguments to GET, INCLUDE, or INCBIN directives
do not need to be fully qualified (see GET or INCLUDE).
-keepinstructs the assembler to keep local labels in the symbol table of the object file, for use by the debugger (see KEEP).
-listlistingfileoptionsinstructs the assembler to output a detailed listing
of the assembly language produced by the assembler to .
If listingfile- is given as ,
listing is sent to listingfilestdout. If no is
given, listing is sent to listingfile.inputfile.lst
Use the following command-line options to control the behavior
of -list:
-noterseturns the terse flag off. When
this option is on, lines skipped due to conditional assembly do
not appear in the listing. If the terse option
is off, these lines do appear in the listing. The default is on.
-widthsets the listing page width. The default is 79 characters.
-lengthsets the listing page length. Length zero means an unpaged listing. The default is 66 lines.
-xrefinstructs the assembler to list cross-referencing information on symbols, including where they were defined and where they were used, both inside and outside macros. The default is off.
-maxcache nsets the maximum source cache size to .
The default is 8MB.n
-memaccess attributesSpecifies memory access attributes of the target
memory system. The default is to allow aligned loads and saves of
bytes, halfwords and words. modify
the default. They can be any one of the following:attributes
+L41Allow unaligned LDRs.
-L22Disallow halfword loads.
-S22Disallow halfword stores.
-L22-S22Disallow halfword loads and stores.
-nocacheturns off source caching. By default the assembler caches source files on the first pass and reads them from memory on the second pass.
-noescinstructs the assembler to ignore C-style escaped
special characters, such as \n and \t.
-noregsinstructs the assembler not to predefine register names. See Predefined register and coprocessor names for a list of predefined register names.
-nowarnturns off warning messages.
-o filenamenames the output object file. If this option is
not specified, the assembler uses the second command-line argument
that is not a valid command-line option as the name of the output
file. If there is no such argument, the assembler creates an object
filename of the form .inputfilename.o
-predefine
"directive"instructs the assembler to pre-execute one of the SET directives.
You must enclose in
quotes. See SETA, SETL, and SETS.
The assembler executes a corresponding directiveGBLL, GBLS,
or GBLA directive to define the variable before setting
its value.
The variable name is case-sensitive.
The command line interface of your system might require you
to enter special character combinations, such as \”,
to include strings in .
Alternatively, you can use directive-via to
include a file-predefine argument. The command line
interface does not alter arguments from -via files.
-split_ldmThis
option instructs the assembler to fault LDM and STM instructions
if the maximum number of registers transferred exceeds:
five, for all STMs,
and for LDMs that do not load the PC
four, for LDMs that load the PC.
Avoiding large multiple register transfers can reduce interrupt latency on ARM systems that:
do not have a cache or a write buffer (for example, a cacheless ARM7TDMI)
use zero wait-state, 32-bit memory.
Avoiding large multiple register transfers increases code size and decreases performance slightly.
Avoiding large multiple register transfers has no significant benefit for cached systems or processors with a write buffer.
Avoiding large multiple register transfers also has no benefit for systems without zero wait-state memory, or for systems with slow peripheral devices. Interrupt latency in such systems is determined by the number of cycles required for the slowest memory or peripheral access. This is typically much greater than the latency introduced by multiple register transfers.
-unsafeallows assembly of a file containing instructions that are not available on the specified architecture and processor. It changes corresponding error messages to warning messages. It also suppresses warnings about operator precedence (see Binary operators).
-via fileinstructs the assembler to open and
read in command-line arguments to the assembler. For further information
see the Via File Syntax appendix in ADS
Compilers and Libraries Guide.file
inputfilespecifies the input file for the assembler. Input files must be ARM or Thumb assembly language source files.