4. Migrating Assembly Language Source Code

Applications developed with the armcl compiler tools may include some source code written in assembly language. Within the scope of this migration guide, this will be referred to as legacy TI-syntax Arm assembly language. Legacy TI-syntax Arm assembly language is any assembly source that is currently accepted by the armcl compiler tools to produce a valid Arm object file. Such assembly source is likely to be rejected when you attempt to assemble it with the tiarmclang compiler tools.

In contrast, we’ll refer to the assembly language syntax accepted by the tiarmclang compiler tools as GNU-syntax Arm assembly source code.

So how does one use legacy TI-syntax Arm assembly source in a project to be built with the tiarmclang compiler tools? There are two choices to be considered:

  • Maintenance planned - If maintenance may be needed during the project life-cycle or if the existing assembly code is likely to be shared or reused by other projects built with the tiarmclang compiler tools, then we recommend that you translate existing legacy TI-syntax code into GNU-syntax Arm assembly source code. Translating most often occurs in either pure assembly source code files or in C/C++ source files that use embedded asm() statements. Translating Legacy TI-Syntax Arm Assembly to GNU-Syntax Arm Assembly provides more details about how to make your assembly source files tiarmclang-friendly for a project that is likely to be maintained over a long period of time.

  • Maintenance unlikely - If maintenance is unlikely during the life of the migrated project, then you can assemble the legacy TI-syntax assembly source using the standalone Arm assembler (armasm). This assembler is shipped as a separate executable with the tiarmclang compiler tools. The object files can then be fed into the link step for the application that is being built. You can also invoke the standalone TI-syntax Arm assembler from tiarmclang using the “-x ti-asm” option to identify TI-syntax assembly source files on the tiarmclang command line. The Invoking the TI-Syntax ARM Assembler from tiarmclang section provides more information about how to do this.