Keil™, An ARM® Company

RealView Assembler User's Guide

Command syntax

3.1. 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 {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 old Thumb syntax. This is equivalent to a CODE16 directive at the head of the source file. Use the ‑‑thumb option to specify Thumb or Thumb‑2 instructions using the new syntax.

‑‑32

Instructs the assembler to interpret instructions as ARM instructions. This is the default.

‑‑apcs [qualifiers]

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

Is a synonym for ‑‑32.

‑‑bigend

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

‑‑brief_diagnostics

See Controlling the output of diagnostic messages.

‑‑littleend

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

‑‑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 and will be removed in a future release. Use ‑‑diag_warning 1206 instead (see Controlling the output of diagnostic messages).

‑‑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

See ‑‑device=list.

‑‑device=name

See ‑‑device=name.

--device_opt=option

See --device_opt=option.

‑‑diag_[error | remark | warning | suppress | style]

See Controlling the output of diagnostic messages.

‑‑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

See Controlling exception table generation.

‑‑exceptions_unwind

See Controlling exception table generation.

‑‑fpmode model

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

‑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

See Listing output to a file

‑‑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 RVCT 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:

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

‑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 and will be removed in a future release.

‑‑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

See Controlling exception table generation.

‑‑no_exceptions_unwind

See Controlling exception table generation.

‑‑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 and will be removed in a future release. Use ‑‑regnames=none instead.

‑‑no_terse

See Listing output to a file

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

‑‑predefine "directive"

Instructs the assembler to pre‑execute one of the SET directives. See Pre‑executing a SET directive for details.

--[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 --[no_]reduce_paths in the RealView Compilation Tools 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).

‑‑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 ARM 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 RealView Compilation Tools Compiler Reference Guide.

‑‑width

See Listing output to a file

‑‑xref

See Listing output to a file

inputfile

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

Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0379A