The current location counter is a counter kept by an assembler to
determine the address assigned to an instruction or constant that
is being assembled. The symbol for the current location counter,
the period (.), represents the address of the current byte.
MACRO-64 sets the current location counter to 0 at the beginning
of the assembly and at the beginning of each new program section.
Every MACRO-64 source statement that allocates memory in the
object module increments the value of the current location
counter by the number of bytes allocated. For example, the
directive, .LONG 0 increments the current location counter by 4.
However, with the exception of the special form described later
in this section, a direct assignment statement does not increase
the current location counter because no memory is allocated.
The current location counter can be explicitly set by a special
form of the direct assignment statement. The location counter can
be either incremented or decremented. This method of setting the
location counter is often useful when defining data structures.
Data-storage areas should not be reserved by explicitly setting
the location counter; use the .BLKx directives.
FORMAT
.=expression
expression
An expression that does not contain any undefined or external
symbols.
In a relocatable psect, the expression must be relocatable; that
is, the expression must be relative to an address in the current
psect. It also may be relative to the current location counter.
For example:
. = .+40 ; Moves location counter forward
When a psect that you defined in the current module is continued,
the current location counter is set to the last value of the
current location counter in that psect.
In a psect with the EXE and NOMIX attributes:
o The location counter cannot be changed.
o If optimization is enabled, the location counter represents
the location before optimization.
In a psect with either the EXE or NOMIX (or both) attributes:
o The location counter can be changed.
o If you store an initial data or instruction value in memory
with a data directive such as .BYTE, .WORD, .LONG, or .QUAD
or with an instruction statement, you can replace that initial
value with a different initial value later in the assembly
by assigning the appropriate address value to the current
location counter and entering another data directive or
instruction statement. However, the new value must be the
same size and must start at exactly the same address as the
value it replaces.