| |||
| Home > Using the Assembler > Built-in variables and constants | |||
Table 19 lists the built-in variables defined by the assembler.
Table 19. Built-in variables
| 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 of
|
|ads$version| | Has the same value as {ARMASM_VERSION}. |
| Is a synonym for |
{COMMANDLINE} | Holds the contents of the command line. |
| Has the value |
| Holds the name of the selected CPU. The
default is |
| Has the value |
{FPIC} | Has the boolean 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 boolean value True if /inter is
set. The default is False. |
{LINENUM} | Holds an integer indicating the line number in the current source file. |
{LINENUMUP} | When used in a macro, holds an integer indicating
the line number of the current macro. The value is same as {LINENUM} when
used in a non-macro context. |
{LINENUMUPPER} | When used in a macro, holds an integer indicating
the line number of the top macro. The value is same as {LINENUM} when
used in a non-macro context. |
| Value of the currently-set listing option.
The |
| Address of current instruction. |
| Is the offset between the address of
the |
{ROPI} | Has the boolean value True if /ropi is
set. The default is False. |
{RWPI} | Has the boolean value True if /rwpi is
set. The default is False. |
| 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"
The built-in variable |ads$version| must
be all in lowercase. The names of the other built-in variables can
be in uppercase, lowercase, or mixed. For example:
IF {CpU} = "Generic ARM"
All built-in string variables contain case-sensitive values.
Relational operations on these built-in variables will not match
with strings that contain an incorrect case. Use the command line options
--cpu and --fpu to determine
valid values for {CPU}, {ARCHITECTURE},
and {FPU}.
Table 20 lists the built-in Boolean constants defined by the assembler.
Table 21 lists
the target CPU related built-in variables that are predefined by
the assembler. Where the value field is empty, the symbol is a boolean
value and the meaning column describes when its value is {TRUE}.
Table 21. Predefined macros
| Name | Value | Meaning |
|---|---|---|
{TARGET_ARCH_ARM} | num | The number of the ARM base architecture of
the target CPU irrespective of whether the assembler is assembling
for ARM or Thumb. For possible values of {TARGET_ARCH_ARM} in
relation to the ARM architecture versions, see Table 22. |
{TARGET_ARCH_THUMB} | num | The number of the Thumb base architecture
of the target CPU irrespective of whether the assembler is assembling
for ARM or Thumb. The value is defined as zero if the target does
not support Thumb. For possible values of |
{TARGET_ARCH_ | - |
|
{TARGET_FEATURE_EXTENSION_REGISTER_COUNT} | num | The number of 64-bit extension registers available in VFP. |
{TARGET_FEATURE_CLZ} | - | If target CPU supports the |
{TARGET_FEATURE_DIVIDE} | - | If the target CPU supports the hardware
divide instructions |
{TARGET_FEATURE_DOUBLEWORD} | - | If the target CPU supports the |
{TARGET_FEATURE_DSPMUL} | - | If the DSP-enhanced multiplier (for example
the SMLA instruction) is
available, for example ARMv5TE. |
{TARGET_FEATURE_MULTIPLY} | - | If the target CPU supports the long multiply
instructions |
{TARGET_FEATURE_MULTIPROCESSING} | - | If assembling for a target CPU with ARMv7 Multiprocessing Extensions. |
{TARGET_FEATURE_UNALIGNED} | - | If the target CPU support for unaligned access (that is, ARMv6 and later except ARMv6-M). |
{TARGET_FPU_SOFTVFP} | If assembling with the option --fpu=softvfp. | |
{TARGET_FPU_SOFTVFP_VFP} | If assembling for a target CPU with softvfp and a hardware vfp, for example --fpu=softvfp+vfpv3. | |
{TARGET_FPU_VFP} | If assembling for a target CPU with a hardware VFP, without using softvfp, for example --fpu=vfpv3 | |
{TARGET_FPU_VFPV2} | If assembling for a target CPU with VFPv2. | |
{TARGET_FPU_VFPV3} | If assembling for a target CPU with VFPv3. | |
{TARGET_PROFILE_M} | If assembling for a Cortex-M profile
CPU (that is, | |
{TARGET_PROFILE_R} | If assembling for a Cortex-R profile CPU (that
is, --cpu=7-R option). |
Table 22 shows
the possible values for {TARGET_ARCH_THUMB} (see Table 21), and how
these values relate to versions of the ARM architecture.
Table 22. {TARGET_ARCH_ARM} in relation to {TARGET_ARCH_THUMB}
| ARM architecture | {TARGET_ARCH_ARM} | {TARGET_ARCH_THUMB} | |
|---|---|---|---|
| v4 | 4 | 0 | 4 |
| v4T | 4 | 1 | 4T |
| v5T | 5 | 2 | 5T |
| v5TE | 5 | 2 | 5TE |
| v5TEJ | 5 | 2 | 5TEJ |
| v6 | 6 | 3 | 6 |
| v6K | 6 | 3 | 6K |
| v6Z | 6 | 3 | 6Z |
| v6T2 | 6 | 4 | 6T2 |
| v6-M | 0 | 3 | 6M |
| v6S-M | 0 | 3 | 6SM |
| v7-R | 7 | 4 | 7R |
| v7-M | 0 | 4 | 7M |
Assembler Reference: