3.4. Built-in variables and constants

Table 3.2 lists the built-in variables defined by the ARM assembler.

Table 3.2. Built-in variables

{ARCHITECTURE}

Holds the name of the selected ARM architecture.

{AREANAME}Holds the name of the current AREA.
{ARMASM_VERSION}Holds an integer that increases with each version. See also Determining the armasm version at assembly time.
|ads$version|Has the same value as {ARMASM_VERSION}.

{CODESIZE}

Is a synonym for {CONFIG}.

{COMMANDLINE}Holds the contents of the command line.

{CONFIG}

Has the value 32 if the assembler is assembling ARM code, or 16 if it is assembling Thumb code.

{CPU}

Holds the name of the selected cpu. The default is ARM7TDMI. If an architecture was specified in the command line --cpu option, {CPU} holds the value "Generic ARM".

{ENDIAN}

Has the value big if the assembler is in big-endian mode, or little if it is in little-endian mode.

{FPIC}Has the value True if /fpic is set. The default is False.
{FPU}Holds the name of the selected fpu. The default is SoftVFP.
{INPUTFILE}Holds the name of the current source file.
{INTER}Has the value True if /inter is set. The default is False.
{LINENUM}Holds an integer indicating the line number in the current source file.
{NOSWST}Has the value True if /noswst is set. The default is False.

{OPT}

Value of the currently-set listing option. The OPT directive can be used to save the current listing option, force a change in it, or restore its original value.

{PC} or .

Address of current instruction.

{PCSTOREOFFSET}

Is the offset between the address of the STR pc,[...] or STM Rb,{..., pc} instruction and the value of pc stored out. This varies depending on the CPU or architecture specified.

{ROPI}Has the value True if /ropi is set. The default is False.
{RWPI}Has the value True if /rwpi is set. The default is False.
{SWST}Has the value True if /swst is set. The default is False.

{VAR} or @

Current value of the storage area location counter.

Built-in variables cannot be set using the SETA, SETL, or SETS directives. They can be used in expressions or conditions, for example:

        IF {ARCHITECTURE} = "4T"

|ads$version| must be all lowercase. The other built-in variables can be uppercase, lowercase, or mixed.

Table 3.3 lists the built-in Boolean constants defined by the ARM assembler.

Table 3.3. Built-in Boolean constants

{FALSE}

Logical constant false.

{TRUE}

Logical constant true.

Copyright © 2002-2005 ARM Limited. All rights reserved.ARM DUI 0204F
Non-Confidential