www.riscos.com Technical Support: |
|
The EQU and * directives are used to give a symbolic name to a fixed or program-relative value. The syntax is:
label EQU expression
label * expression
RN defines register names. Registers can only be referred to by name. The names R0-R15, r0-r15, PC, pc, LR, lr, SP and sp are predefined. Names may also be defined for the registers used by the ARM Procedure Call Standard; see Controlling syntax.
FN defines the names of floating point registers. The names F0-F7 and f0-f7 are built in. The syntax is:
label RN numeric-expression
label FN numeric-expression
CP gives a name to a coprocessor number, which must be within the range 0 to 15. The names p0-p15 are pre-defined.
CN names a coprocessor register number; c0-c15 are pre-defined. The syntax is:
label CP numeric-expression
label CN numeric-expression
While most symbols have fixed values determined during assembly, variables have values which may change as assembly proceeds. The assembler supports both global and local variables. The scope of global variables extends across the entire source file while that of local variables is restricted to a particular instantiation of a macro (see the chapter entitled Macros). Variables must be declared before use with one of these directives.
GBLA | Declares a global arithmetic variable. Values of arithmetic variables are 32-bit unsigned integers. |
GBLL | Declares a global logical variable |
GBLS | Declares a global string variable |
LCLA | Declares and initialises a local arithmetic variable (initial state zero) |
LCLL | Declares and initialises a local logical variable (initial state false) |
LCLS | Declares and initialises a local string variable (initial state null string) |
The syntax of these directives is:
directive variable-name
The value of a variable can be altered using the relevant one of the following three directives:
SETA | Sets the value of an arithmetic variable |
SETL | Sets the value of a logical variable |
SETS | Sets the value of a string variable |
The syntax of these directives is:
variable-name directive expression
where expression evaluates to the value being assigned to the variable named.
(You can also declare and set the value of global variables at assembly time; see Predefining a variable.)
Once a variable has been declared its name cannot be used for any other purpose, and any attempt to do so will result in an error. However, if the $ character is prefixed to the name, the variable's value will be substituted before the assembler checks the line's syntax. Logical and arithmetic variables are replaced by the result of performing a :STR: operation on them (see Unary operators); string variables are replaced by their value.
There are seven built-in variables. They are: