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

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 new options, “-Wti-a,” and “-Xti-assembler” are supported. These behave similarly to tiarmclang’s other “-W” and “-X” options. Please see -Xlinker flag and -Wl flag for examples of the “-X” and “-W” options that apply to the linker.

Some helpful options available for use are:

  • --define/--undefine - pre-define (or undefine) an identifier to a value, similar to tiarmclang’s -D and -U compiler options.

  • --include_file - effectively process an “.include file” directive before reading the assembly source file itself.

  • --include_path - similar to the tiarmclang’s -I compiler option, adding a specified directory to the search path used to find the subject of a “.include file” directive.

  • --no_warnings - suppresses all warnings that are emitted by the TI-syntax ARM assembler.

Remember that when passing one of the above options to the TI-syntax ARM assembler from the tiarmclang command line, to precede the option with the 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”.

Note

The .cdecls directive is not supported

The .cdecls directive, which for armcl projects allows programmers in mixed assembly and C/C++ environments to share C headers containing declarations and prototypes between the C and assembly code, is not supported by the TI-Syntax ARM Assembler included with tiarmclang.