10.5.1. Configuring the RealView Assembler

This section describes how to configure the RealView Assembler (armasm) from within the CodeWarrior IDE. It provides general descriptions of the available assembler options.

Note

Many of the configuration settings described here use default settings that are appropriate for most development projects. However, you should review at least the Target options and PCS options to ensure that they are suitable for your project.

The RealView Assembler panel consists of a number of tabbed configuration panels. The available options are described in:

These sections provide general descriptions of the available assembler options. For more detailed descriptions, see the RealView Compilation Tools Assembler Guide.

Configuring the target and architecture

Use the Target configuration panel to configure the target processor and architecture for the RealView Assembler:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the Target tab to display the configuration panel (see Figure 10.14).

    Figure 10.14. RealView Assembler Target configuration panel

    RealView Assembler Target configuration panel
  3. Select target options, as required:

    Architecture or Processor

    Select the processor or architecture for your target hardware from the drop-down menu. Some processor-specific instructions produce either errors or warnings if compiled for the wrong target architecture.

    Note

    If you select a processor from the Architecture or Processor drop-down menu, the following behavior applies:

    • Specifying the processor selects the appropriate architecture and FPU.

    • Some processor specifications imply an FPU selection. For example, when compiling in ARM state, choosing ARM1136JF-S implies VFPv2.

      Be aware that any explicit FPU (set with --fpu) on the command line overrides an implicit FPU.

  4. Select floating-point options:

    Floating Point

    Use this option to select the target Floating Point Unit (FPU) architecture. Floating-point instructions produce either errors or warnings if assembled for the wrong target FPU. Choose from:

    [auto]

    Use the floating-point selection based on the chosen processor or architecture (using the Architecture or Processor drop-down menu).

    This is the default setting.

    VFPv3

    Select this option to target hardware vector floating-point units conforming to architecture VFPv3.

    VFPv3 is backwards compatible with VFPv2 except that VFPv3 cannot trap floating-point exceptions. If your project does not make use of floating-point exception trapping, it should work without any changes on VFPv3.

    VFPv2

    Select this option to target hardware vector floating-point units conforming to architecture VFPv2.

    SoftVFP

    Select this option to use software floating-point linkage.

    SoftVFP+VFPv2

    Selects software floating-point library with software floating-point linkage, and requires a VFP unit conforming to architecture VFPv2. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFP unit.

    SoftVFP+VFPv3

    Selects software floating-point library with software floating-point linkage, and requires a VFP unit conforming to architecture VFPv3. Select this option if you are interworking Thumb code with ARM code on a system that implements a VFP unit.

    None

    Select this option if you are not targeting a hardware floating-point unit, nor using the software floating-point library. This produces an error if your code contains floats.

    Floating Point Models

    Use this option to select the floating-point model to use. The model specifies floating-point conformance and sets library attributes and floating-point optimizations. Choose from:

    Full IEEE

    All facilities, operations, and representations guaranteed by the IEEE standard are available in single and double-precision.

    Fixed IEEE: round-to-nearest, no inexact exceptions

    IEEE standard with round-to-nearest and no inexact exceptions.

    Stateless IEEE: compatible with Java

    IEEE standard with round-to-nearest and no exceptions. This mode is compatible with the Java floating-point arithmetic model.

    C/C++ Language Standard

    IEEE finite values with denormals flushed to zero, round-to-nearest, and no exceptions. This model is C and C++ compatible. This is the default option.

    Fast mode, as supported by the VFP

    Perform more aggressive floating-point optimizations that might cause a small loss of accuracy to provide a significant performance increase. This option results in behavior that is not fully ISO C and C++ standard-compliant, however, numerically robust floating-point programs behave correctly.

  5. Select the instruction set to use:

    Initial State

    This option sets up the initial state of the RealView Assembler to assemble instructions in the source as ARM or Thumb instructions. This state remains until an ARM, THUMB, CODE16, or CODE32 directive is processed in the code. Choose from:

    [auto]

    Uses the default state for the selected processor. This invokes the RealView Assembler with armasm, and is the default setting.

    ARM

    Start the assembler in ARM state. This instructs the assembler to interpret instructions as ARM instructions.

    This is equivalent to an ARM or a CODE32 directive in the code, or to invoking the RealView Assembler with armasm --arm or armasm --32.

    Thumb

    Start the assembler in Thumb state. This instructs the assembler to interpret instructions as 32-bit Thumb-2 instructions or 16-bit Thumb instructions using ARM syntax.

    This is equivalent to a THUMB directive in the code, or to invoking the RealView Assembler with armasm --thumb.

    Legacy Thumb

    Start the assembler in Thumb state. This instructs the assembler to interpret instructions as 16-bit Thumb instructions using old Thumb syntax.

    This is equivalent to a CODE16 directive in the code, or to invoking the RealView Assembler with armasm --16.

  6. Select the byte order used by your target hardware. This can be either Little Endian or Big Endian. The default setting is Little Endian.

  7. Click Apply to apply your changes without closing the Target Settings window.

See the RealView Compilation Tools Assembler Guide for information on the ARM, Thumb, and Thumb-2 instruction sets.

Configuring PCS options

Selecting PCS (Procedure Call Standard) options sets the appropriate attribute values for the code sections generated by the assembler. The linker checks the attribute values at link time and generates error messages if you attempt to link incompatible objects.

Note

Selecting PCS options does not provide checks that your assembly language code conforms to a given PCS variant. You must ensure that your assembly language code follows the conventions required by the PCS options you select.

If you expect to call your assembly language code from C or C++, you must ensure that your RealView Compiler is configured to use the same calling standard. See Configuring PCS and code generation options for details.

To configure the PCS settings for the RealView Assembler:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the PCS tab to display the configuration panel (Figure 10.15).

    Figure 10.15. RealView Assembler PCS configuration panel

    RealView Assembler PCS configuration panel
  3. Select the PCS variant that you require using the Procedure Call Standard Options group box:

    ARM/Thumb interworking

    Select this option if you are writing ARM code that you want to interwork with Thumb code, or Thumb code that you want to interwork with ARM code, and you are writing the correct interworking return instructions. The linker generates suitable interworking veneers if necessary at link time. See the description of interworking in the RealView Compilation Tools Developer Guide for more information.

    Read-only position independent

    Select this option to mark your code as read-only position-independent. When this flag is set, the assembler sets the PI attribute on read-only sections it outputs.

    Read-write position independent

    Select this option to mark your code as read-write position-independent. When this flag is set, the assembler sets the PI attribute on read-write sections it outputs.

  4. Click Apply to apply your settings without closing the Target Settings window.

Configuring assembler options

To configure other assembler options, such as debug options and listing control:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the Options tab to display the configuration panel (Figure 10.16).

    Figure 10.16. RealView Assembler Options configuration panel

    RealView Assembler Options configuration panel
  3. Select debug options, as required:

    Source Line Debug

    Select this option to instruct the assembler to generate debug tables. This option is set by default for all ARM project stationery.

    Keep Symbols

    Select this option to keep local labels in the symbol table of the object file, for use by the debugger. This option is set by default for all ARM project stationery.

  4. Select options for code listings generated by the assembler, as required:

    Listing on

    Select this option to instruct the assembler to output a detailed listing of the assembly language it produces after resolving assembler constructs such as directives and pseudo-instructions. The listing is displayed in a new text window. You can define how the listing is displayed in this window in the Dimensions group box.

    Terse

    Deselect this option to display lines skipped due to conditional assembly in the listing.

    Cross-references

    Select this option to instruct the assembler to list cross-referencing information on symbols, including where they were defined and where they were used, both inside and outside macros.

  5. Click Apply to apply your settings without closing the Target Settings window.

Configuring predefined variables

Use the Predefines configuration panel to configure the assembler to predefine a global variable and execute one of the SET directives to set its value, for example:

Debug SETL {TRUE}

The SET directives enable you to configure numeric, string, or logical variables. See the RealView Compilation Tools Assembler Guide for detailed information on using these directives.

To predefine a new variable:

  1. Display the Target Settings configuration panel for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the Predefines tab to display the configuration panel (Figure 10.17).

    Figure 10.17. RealView Assembler Predefines configuration panel

    RealView Assembler Predefines configuration panel
  3. Enter the name of the variable in the Variable Name field. Alternatively, if you want to modify or delete an existing predefined variable, select the variable from the List of Predefines drop-down menu.

  4. Select the directive you require. Use:

    • SETA, for numeric expressions

    • SETL, for logical expressions

    • SETS, for string expressions.

  5. Enter the variable value using one of the following:

    • Enter the value in Numeric Value, if you have selected a SETA directive.

    • Click the appropriate Boolean, if you have selected a SETL directive.

    • Enter a quoted string in the String Value field, if you want use the SETS directive, for example, "dollar string".

      When you add the variable, the CodeWarrior IDE automatically inserts the escape character prefix \ for the quotes, for example:

      --predefine="STRING_DEF SETS \"dollar string\""
      

      Note

      If you want to add this line to the Equivalent Command Line text box directly, you must include the escape characters. In this case, they are not inserted automatically.

  6. Click either:

    • Add, if you are creating a new variable definition

    • Replace, if you are modifying an existing variable definition

    • Delete, to delete an existing variable definition.

  7. Click Apply to apply your settings without closing the Target Settings window.

Configuring diagnostic information

To control the output of the diagnostic messages generated by the assembler:

  1. Display the Target Settings window for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the Diagnostics tab to display the configuration panel (Figure 10.18).

    Figure 10.18. RealView Assembler Diagnostics configuration panel

    RealView Assembler Diagnostics configuration panel
  3. Select which diagnostic messages are to be suppressed or reclassified.

    Enter a tag, or a list of tags separated by commas, as required:

    Suppress

    Disables all diagnostic messages that have the specified tag(s).

    Set to warning

    Sets the diagnostic messages that have the specified tag(s) to Warning severity.

    Set to error

    Sets the diagnostic messages that have the specified tag(s) to Error severity.

    No Warnings

    Select this option to turn off all warning messages.

  4. Click Apply to apply your settings without closing the Target Settings window.

Reading assembler options from a file

Use the Extras configuration panel to specify a via file for the assembler. A via file is a text file that contains additional command-line arguments to the assembler. Via files are read when the assembler is invoked. The via file options are processed after the options specified in the configuration panels, and override them if there is a conflict. You can use via files:

  • to ensure that the same assembler settings are used by different build targets and projects

  • to include exceptionally long command-line options to the assembler.

See the RealView Compilation Tools Compiler User Guide for a description of via file syntax.

To specify a via file:

  1. Display the Target Settings window for the build target you want to configure (see Displaying Target Settings panels).

  2. Click RealView Assembler in the Target Settings Panels list and click the Extras tab to display the configuration panel (Figure 10.19).

    Figure 10.19. RealView Assembler Extras configuration panel

    RealView Assembler Extras configuration panel
  3. Enter the path name of the via file, or click Choose… and select the via file from the standard file dialog.

  4. Click Apply to apply your settings without closing the Target Settings window.

Copyright © 1999-2001, 2005-2007 ARM Limited. All rights reserved.ARM DUI 0065G
Non-Confidential