You copied the Doc URL to your clipboard.

Arm Compiler armclang Reference Guide : -masm

-masm

Enables Arm® Development Studio to select the correct assembler for the input assembly source files.

Default

-masm=gnu

Syntax

-masm=assembler

Parameters

The value of assembler can be one of:

auto

Automatically detect the correct assembler from the syntax of the input assembly source file.

If the assembly source file contains GNU syntax assembly code, then invoke armclang integrated assembler.

If the assembly source file contains legacy armasm syntax assembly code, then invoke the legacy armasm assembler. The most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options.

Note

In rare circumstances, the auto-detection might select the wrong assembler for the input file. For example, if the input file is a .S file that requires preprocessing, auto-detection might select the wrong assembler. For the files where auto-detection selects the wrong assembler, you must select -masm=gnu or -masm=armasm explicitly.
gnu
Invoke the armclang integrated assembler.
armasm
Invoke the legacy armasm assembler. The most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options.

Operation

If you use Arm Development Studio to build projects with the CMSIS-Pack, then use -masm=auto, because some of the assembly files in the CMSIS-Pack contain legacy armasm syntax assembly code. When invoking the legacy armasm assembler, the most commonly used options are translated from the armclang command-line options to the appropriate armasm command-line options, which the Translatable options table shows.

Table 1-4 Translatable options

armclang option armasm option
-fropi --apcs=/ropi
-frwpi --apcs=/rwpi

-mfloat-abi=soft

-mfloat-abi=softfp

-mfloat-abi=hard

--apcs=/softfp

--apcs=/softfp

--apcs=/hardfp

-mfpu --fpu
-mbig-endian --bigend
-mlittle-endian --littleend
-g -g
-ffp-mode --fpmode
-DNAME --predefine "NAME SETA 1"
-Idir -idir

If you need to provide additional options to the legacy armasm assembler, which are not listed in the Translatable options table, then use -Wa,armasm,option,value. For example:

  • If you want to use the legacy armasm assembler option --show_cmdline to see the command-line options that have been passed to the legacy armasm assembler, then use:

    -Wa,armasm,--show_cmdline
  • If the legacy armasm syntax source file requires the option --predefine "NAME SETA 100", then use:

    -Wa,armasm,--predefine,"NAME SETA 100"
  • If the legacy armasm syntax source file requires the option --predefine "NAME SETS \"Version 1.0\"", then use:

    -Wa,armasm,--predefine,"NAME SETS \"Version 1.0\""

    Note

    The command-line interface of your system might require you to enter special character combinations to achieve correct quoting, such as \" instead of ".

Note

Arm Compiler 6 provides the -masm option as a short term solution to enable the assembly of legacy armasm syntax assembly source files. The -masm option will be removed in a future release of Arm Compiler 6. Arm recommends that you migrate all legacy armasm syntax assembly source files into GNU syntax assembly source files. For more information, see Migrating from armasm to the armclang integrated assembler in the Migration and Compatibility Guide.

If you are using the compiler from outside Arm Development Studio, such as from the command-line, then Arm recommends that you do not specify the -masm option, and instead invoke the correct assembler explicitly.

Was this page helpful? Yes No