The .BASE directive is used to inform the assembler that a
specified base register contains a specified base address. Later
in your program, the assembler allows you to implicitly reference
the specified base register. When the assembler knows which
base addresses are stored in one or more base registers, it can
convert an expression to an offset from one of the base registers
previously specified in a .BASE directive. .BASE provides a
convenient and more readable shorthand for accessing memory and
constant values using base registers. .BASE also makes it easier
for you to change your register assignments if you later modify
your code.
The base expression is optional. If the base expression is
specified, this base address value is assumed by the assembler
to be in the specified register, Rn. If the base expression is
omitted, the contents of the specified base register, Rn, is
considered undefined until a new base expression is associated
with the base register.
R31 is defined to always contain 0, according to the architecture
definition. Therefore, R31 is known to be a predefined base
register containing 0. For every assembly, the assembler assumes
the following statement:
.BASE R31, 0
Because the contents of R31 cannot change, you cannot specify a
base address for R31.
You can use the .BASE directive to implicitly reference base
registers. You can also automatically compute offsets from a base
address known to be in a register to a base address you use in an
instruction argument.
Most of the memory format Alpha instructions are defined
such that one of their arguments must have a base register and
an offset. If the assembler encounters only an expression with
no base register, the assembler attempts to find a base register
that contains a base address or constant within a 16-bit signed
offset of the value of the expression. If it finds such a base
register, the assembler computes an offset that, when added to
the value of the base register, results in a value equal to the
expression specified in the instruction argument.