3.1. Command syntax

This section relates only to armasm. The inline and embedded 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. The ARM assembler uses the normal command line ordering rules as described in Ordering command-line options in the Compiler User Guide. Therefore, if the command line contains options that conflict with each other, then the last one found always takes precedence.

Invoke the ARM assembler using this command:

armasm {options} {inputfile}

where options can be any combination of the following, separated by spaces:

--16

Instructs the assembler to interpret instructions as Thumb® instructions using the pre-UAL Thumb syntax. This is equivalent to a CODE16 directive at the head of the source file. Use the --thumb option to specify Thumb instructions using the UAL syntax.

--32

Is a synonym for --arm.

--apcs qualifier

Specifies whether you are using the Procedure Call Standard for the ARM Architecture (AAPCS). It can also specify some attributes of code sections. See AAPCS for details.

--arm

Instructs the assembler to interpret instructions as ARM instructions. It does not, however, guarantee ARM-only code in the object file. This is the default.

--arm_only

Instructs the assembler to only generate ARM code. The resulting object file does not contain or permit any Thumb code.

--bi

Is a synonym for --bigend.

--bigend

Instructs the assembler to assemble code suitable for a big-endian ARM. The default is --littleend.

--brief_diagnostics
--checkreglist

Instructs 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.

This option is deprecated. Use --diag_warning 1206 instead (see Controlling the output of diagnostic messages).

--compatible=name

Enables code generated by the assembler to be compatible with multiple processors or architectures. name is the CPU or architecture name that the code is to be compatible with, see CPU names.

--cpreproc

Instructs the assembler to call armcc to preprocess the input file before assembling it. See Using the C preprocessor.

--cpreproc_opts=options

Enables the assembler to pass compiler options to armcc when using the C preprocessor. See Using the C preprocessor.

options is a comma-separated list of options and their values.

--cpu name

Sets the target CPU. See CPU names.

--debug

Instructs the assembler to generate DWARF debug tables. --debug is a synonym for -g.

The default is DWARF 3.

Note

Local symbols are not preserved with --debug. You must specify --keep if you want to preserve the local symbols to aid debugging.

--depend dependfile

Instructs the assembler to save source file dependency lists to dependfile. These are suitable for use with make utilities.

--depend_format=string

Changes the format of output dependency files to UNIX-style format, for compatibility with some UNIX make programs.

The value of string can be one of:

unix

Generates dependency files with UNIX-style path separators.

unix_escaped

Is the same as unix, but escapes spaces with backslash.

unix_quoted

Is the same as unix, but surrounds path names with double quotes.

--device=list

Lists the supported device names that can be used with the --device=name option.

--device=name

Selects a specific device and sets the associated processor settings. See --device=name in the Compiler Reference Guide.

--diag_error, , --diag_remark, , --diag_warning, , --diag_suppress, , --diag_style
--dllexport_all

Gives all exported global symbols STV_PROTECTED visibility in ELF rather than STV_HIDDEN, unless overridden by source directives (see EXPORT or GLOBAL).

--dwarf2

Use with --debug, to instruct the assembler to generate DWARF 2 debug tables.

--dwarf3

Use with --debug, to instruct the assembler to generate DWARF 3 debug tables. This is the default if --debug is specified.

--errors errorfile

Instructs the assembler to output error messages to errorfile.

--exceptions
--exceptions_unwind
--execstack

Generates a .note.GNU-stack section marking the stack as executable.

You can use the AREA directive to generate an executable .note.GNU-stack section:

    AREA    |.note.GNU-stack|,ALIGN=0,READONLY,NOALLOC,CODE

In the absence of --execstack and --no_execstack, the .note.GNU-stack section is not generated unless it is specified by the AREA directive.

If both the command line option and source directive are used and are different, then the stack is marked as executable, see Table 3.1.

See AREA.

--fpmode model

Specifies the floating-point conformance, and sets library attributes and floating-point optimizations. See Floating‑point model.

--fpu name

Selects the target floating-point unit (FPU) architecture. See FPU names.

-g

Is a synonym for --debug.

-idir{,dir,…}

Adds directories to the source file have to be fully qualified (see GET or INCLUDE).

--keep

Instructs the assembler to keep local labels in the symbol table of the object file, for use by the debugger (see KEEP).

--length
--li

Is a synonym for --littleend.

--library_type=lib

Enables the relevant library selection to be used at link time.

Where lib can be one of:

standardlib

Specifies that the full ARM runtime libraries are selected at link time. This is the default.

microlib

Specifies that the C micro-library (microlib) is selected at link time.

Note

This option can be used with the compiler, assembler or linker when use of the libraries require more specialized optimizations.

Use this option with the linker to override all other --library_type options.

For more information see:

--licretry

Instructs the assembler to retry checking out licenses up to 10 times, approximately 10 seconds apart, upon encountering certain FLEXnet error codes.

--list file

Instructs the assembler to output a detailed listing of the assembly language produced by the assembler to file. See Listing output to a file for details.

--littleend

Instructs the assembler to assemble code suitable for a little-endian ARM.

-m

Instructs the assembler to write source file dependency lists to stdout.

--maxcache n

Sets the maximum source cache size to n bytes. The default is 8MB. armasm gives a warning if size is less than 8MB.

--md

Instructs the assembler to write source file dependency lists to inputfile.d.

--memaccess attributes

Specifies memory access attributes of the target memory system. See Memory access attributes.

Note

The --memaccess option is deprecated.

--no_code_gen

Instructs the assembler to exit after pass 1. No object file is generated.

--no_esc

Instructs the assembler to ignore C-style escaped special characters, such as \n and \t.

--no_exceptions
--no_exceptions_unwind
--no_execstack

Generates a .note.GNU-stack section marking the stack as non-executable.

You can use the AREA directive to generate a non executable .note.GNU-stack section:

    AREA    |.note.GNU-stack|,ALIGN=0,READONLY,NOALLOC

In the absence of --execstack and --no_execstack, the .note.GNU-stack section is not generated unless it is specified by the AREA directive.

If both the command line option and source directive are used and are different, then the stack is marked as executable.

Table 3.1. Specifying a command line option and an AREA directive for GNU-stack sections

 

--execstack command line option

--no_execstack command line option

execstack AREA directive

execstack

execstack

no_execstack AREA directive

execstack

no_execstack


See AREA.

--no_hide_all

Gives all exported and imported global symbols STV_DEFAULT visibility in ELF rather than STV_HIDDEN, unless overridden by source directives (see EXPORT or GLOBAL and IMPORT and EXTERN).

--no_regs

Instructs the assembler not to predefine register names. See Predefined register and coprocessor names for a list of predefined register names.

This option is deprecated. Use --regnames=none instead.

--no_terse
--no_unaligned_access

Instructs the assembler to set an attribute in the object file indicating that unaligned accesses are not used.

--no_warn

Turns off warning messages.

-o filename

Names the output object file. If this option is not specified, the assembler creates an object filename of the form inputfilename.o. This option is case-sensitive.

--pd

Is a synonym for --predefine.

--predefine "directive"

Instructs the assembler to pre-execute one of the SET directives. See Pre‑executing a SET directive for details. This is useful for conditional assembly (see Example 7.3).

--project=filename, , --no_project=filename
--reduce_paths, , --no_reduce_paths

Enables or disables the elimination of redundant pathname information in file paths. This option is valid for Windows systems only.

Windows systems impose a 260 character limit on file paths. Where relative pathnames exist whose absolute names expand to longer than 260 characters, you can use the --reduce_paths option to reduce absolute pathname length by matching up directories with corresponding instances of .. and eliminating the directory/.. sequences in pairs.

Note

It is recommended that you avoid using long and deeply nested file paths, in preference to minimizing path lengths using the --reduce_paths option.

See --reduce_paths, --no_reduce_paths in the Compiler Reference Guide for more information.

--regnames=none

Instructs the assembler not to predefine register names. See Predefined register and coprocessor names for a list of predefined register names.

--regnames=callstd

Defines additional register names based on the AAPCS variant that you are using as specified by the --apcs option (see AAPCS for details).

--regnames=all

Defines all AAPCS registers regardless of the value of --apcs (see AAPCS for details).

--reinitialize_workdir
--report-if-not-wysiwyg

Instructs the assembler to report when the assembler outputs an encoding that was not directly requested in the source code. This can happen when the assembler:

  • uses a pseudo-instruction that is not available in other assemblers, for example MOV32

  • outputs an encoding that does not directly match the instruction mnemonic, for example if the assembler outputs the MVN encoding when assembling the MOV instruction

  • inserts additional instructions where necessary for instruction syntax semantics, for example the assembler can insert a missing IT instruction before a conditional Thumb instruction.

--show_cmdline

Shows how the assembler has processed the command line. The commands are shown normalized, and the contents of any via files are expanded.

--split_ldm

Instructs the assembler to fault long LDM and STM instructions. See Splitting long LDMs and STMs for details. Use of this option is deprecated.

--thumb

Instructs the assembler to interpret instructions as Thumb instructions, using the UAL syntax. This is equivalent to a THUMB directive at the head of the source file.

--unaligned_access

Instructs the assembler to set an attribute in the object file indicating the use of unaligned accesses.

--unsafe

Enables instructions from differing architectures to be assembled without error. See Controlling the output of diagnostic messages).

--untyped_local_labels

Forces the assembler not to set the Thumb bit when referencing labels in Thumb code. See LDR pseudo‑instruction for details.

--via file

Instructs the assembler to open file and read in command-line arguments to the assembler. For more information see Appendix A Via File Syntax in the Compiler Reference Guide.

--width
--workdir=directory
--xref
inputfile

Specifies the input file for the assembler. Input files must be UAL or pre-UAL Thumb assembly language source files.

Copyright © 2002-2010 ARM. All rights reserved.ARM DUI 0204J
Non-ConfidentialID101213