You copied the Doc URL to your clipboard.

ARM Compiler armasm User Guide : SETA, SETL, and SETS

SETA, SETL, and SETS

The SETA, SETL, and SETS directives set the value of a local or global variable.

Syntax

variable setx expr

where:

variable

is the name of a variable declared by a GBLA, GBLL, GBLS, LCLA, LCLL, or LCLS directive.

setx

is one of SETA, SETL, or SETS.

expr

is an expression that is:

  • Numeric, for SETA.

  • Logical, for SETL.

  • String, for SETS.

Usage

The SETA directive sets the value of a local or global arithmetic variable.

The SETL directive sets the value of a local or global logical variable.

The SETS directive sets the value of a local or global string variable.

You must declare variable using a global or local declaration directive before using one of these directives.

You can also predefine variable names on the command line.

Restrictions

The value you can specify using a SETA directive is limited to 32 bits. If you exceed this limit, the assembler reports an error. A possible workaround in A64 code is to use an EQU directive instead of SETA, although EQU defines a constant, whereas GBLA and SETA define a variable.

For example, replace the following code:

                        GBLA    MyAddress
      MyAddress         SETA    0x0000008000000000

with:

      MyAddress         EQU     0x0000008000000000      

Examples

                GBLA    VersionNumber
VersionNumber   SETA    21
                GBLL    Debug
Debug           SETL    {TRUE}
                GBLS    VersionString
VersionString   SETS    "Version 1.0"
Was this page helpful? Yes No