5.3. TI-Syntax Arm Assembler

tiarmasm is the name of the TI-syntax Arm assembler that is include in the tiarmclang compiler tools installation. It is essentially the same TI-syntax Arm assembler that is provided with the legacy TI Arm Code Generation Tools, armasm.

For more details about the legacy TI Arm Code Generation Tools support for processing TI-syntax Arm assembly source, please refer to either of the following documents:

The remainder of this section will provide basic useful information about how to use tiarmasm, the standalone TI-syntax Arm assembler, in the context of the TI Arm Clang Compiler Tools.

5.3.1. Invoking the TI-Syntax Arm Assembler from tiarmclang

The tiarmclang compiler can be instructed to process input files with its TI-syntax Arm assembler. The assembly language source files, written using legacy TI-syntax Arm assembly code, can be indicated to the tiarmclang compiler using the “-x language” option, where language is “ti-asm”. This option applies to all subsequent input files, so be sure to reset the input file type if there are non-TI-syntax Arm assembly source files on the command line following the TI-syntax Arm assembly source files.

tiarmclang -x ti-asm <ti-syntax asm file> [options] [filenames]

For example, in the following command:

%> tiarmclang c-source1.c -x ti-asm ti-asm-source1.asm -x none c-source2.c

the “-x ti-asm” option indicates that the ti-asm-source1.asm file is to be processed by the TI-syntax Arm assembler, and the subsequent “-x none” option resets the input file type to a default state so that the tiarmclang compiler knows to process the c-source2.c input file as a C file.

While many important options that need to be passed to the TI-syntax Arm assembler, such as silicon version and FPU version, can be inferred from the compiler’s normal command line options, other options that you might need may be missing or need to be overridden. To support this, two tiarmclang options, -Wti-a, and -Xti-assembler, are supported. These behave similarly to tiarmclang’s other -W and -X options. Please see Passing Options to Other Tools from tiarmclang for a more detailed discussion and examples of how to use tiarmclang’s -X and -W options.

5.3.2. Invoking TI-Syntax Arm Assembler Directly

To invoke the TI-syntax Arm assembler, tiarmasm, from the command-line, enter the following:

tiarmasm [options] [filenames]

  • tiarmasm - Command that invokes the standalone TI-syntax Arm assembler.

  • options - TI-syntax Arm assembler options. When tiarmasm is invoked directly, the assembler options need not be preceded by tiarmclang’s -Xti-assembler or -Wti-a, options.

  • filenames - TI-syntax Arm assembly source files.

5.3.3. TI-Syntax Arm Assembler Options

As mentioned above, when the TI-syntax Arm assembler is invoked from the tiarmclang command-line, options that are intended for the TI-syntax Arm assembler must be preceded by tiarmclang’s -Xti-assembler or -Wti-a, option. In this example:

%> tiarmclang ... -x ti-asm tia.asm -Xti-assembler --define=MY_PREDEF_SYM=10 ...

the --define=MY_PREDEF_SYM=10 option is passed to the TI-syntax Arm assembler when processing the TI-syntax Arm assembly source file, tia.asm.

In the list of TI-syntax Arm assembler options described below, the syntax for each option is presented as if the option were specified when the TI-syntax Arm assembler is invoked directly from the command line.

-d=*<name>*[=*<value>*], --define=*<name>*[=*<value>*]

Define assembly constant symbol <name> with <value>, if the <value> argument is specified. If the <value> argument is omitted, <name> is given a value of 1.

--depend, --asm_dependency

Perform preprocessing for assembly files, but instead of writing preprocessed output, write a list of dependency lines suitable for input to a standard make utility. The list is written to a file with the same name as the source file but with a .ppa extension.

--includes, --asm_includes

Perform preprocessing for assembly files, but instead of writing preprocessed output, write a list of files included with the .include directive. The list is written to a file with the same name as the source file but with a .ppa extension.

-hc=*<file>*, --copy_file=*<file>*

Include the specified <file> for the assembly module. The <file> is included before source file statements. The included <file> will appear in assembly listing files that are generated by the assembler.

-hi=*<file>*, --include_file=*<file>*

Include the specified <file> for the assembly module. The <file> is included before source file statements. The included <file> will not appear in any assembly listing files that are generated by the assembler.

-l, --asm_listing

Produce a listing file with the same name as the input file with a .lst extension

-u=*<name>*, --undefine=*<name>*

Undefine the predefined symbol constant <name>, which overrides any --define options for the specified <name>.

--thumb_state, -mt

The --thumb option is a synonym for the --code_state=16 option. Instruct the assembler to begin assembling instructions as 16-bit instructions. This option is off by default.

--code_state=[16|32]

The --code_state=16 option instructs the assembler to begin assembling instructions as 16-bit instructions. By default, the assembler begins assembling 32-bit instructions.

--endian=[little|big]

Produce object code in little-endian or big-endian format as indicated by the option argument. The tiarmclang compiler tools only support big-endian object files for Cortex-R series Arm processors.

-i=<*path>*, --include_path=*<path>*

Specify a directory <path> where the assembler can find files named by the .copy, .include, or .mlib directives. There is no limit to the number of directories you can specify in this manner; each pathname must be preceded by the --include_path option.

-q, --quiet

Suppress the banner and progress information (assembler runs in quiet mode).

-v=*<cpu>*, --silicon_version=*<cpu>*

Select target Arm processor variant to assemble for. The supported values for the specified <cpu> argument include:

  • 6M0 - Cortex-M0 processor

  • 7M3 - Cortex-M3 processor

  • 7M4 - Cortex-M4 processor

  • 7R4 - Cortex-R4 processor

  • 7R5 - Cortex-R5 processor

Note

The standalone TI-syntax Arm assembler does not currently support the Arm Cortex-m33 processor. Use of Cortex-m33 instructions must be compiled or assembled using the tiarmclang compiler and its integrated GNU-syntax Arm assembler.

-@=*<file>*, --cmd_file=*<file>*

Append the contents of a <file> to the command line. You can use this option to avoid limitations on command line length imposed by the host operating system.

--float_support=*<fpu>*

Enable use of floating-point hardware registers and instructions. The supported values for the specified <fpu> argument include:

  • FPv4SPD16 - available in combination with Arm Cortex-M4 processor

  • VFPv3D16 - available in combination with Arm Cortex-M4 or Cortex-R5 processor

--unaligned_access=[on|off]

Enable (on) or disable (off) use of unaligned memory accesses for load and store instructions. Unaligned memory accesses are not available on the Arm Cortex-M0 processor.

--no_warnings

Suppress assembler warnings.

-pdew, --emit_warnings_as_errors

Treat warnings as errors.

-c, --syms_ignore_case

Symbol names are parsed and converted to upper case.

-f, --suppress_asm_extension

Don’t assume source file has a .asm file extension.

-g, --symdebug:dwarf

Encode symbolic debug information in generated object code.

-h, --help, --usage, -?

Display help output.