Location counter
The assembler maintains a location counter to assign storage addresses to your program statements. It is the assembler's equivalent of the execution-time instruction counter in the computer. You can refer to the current value of the location counter at any place in a source module by specifying an asterisk (*) as a term in an operand.
As the instructions and constants of a source module are being
assembled, the location counter has a value that indicates a location
in the program. The assembler increments the location counter according
to the following:
- After an instruction or constant has been assembled, the location counter indicates the next available location.
- Before assembling the current instruction or constant, the assembler checks the boundary alignment required for it and adjusts the location counter, if necessary, to the correct boundary.
- While the instruction or constant is being assembled, the location counter value does not change. It indicates the location of the current data after boundary alignment and is the value assigned to the symbol, if present, in the name field of the statement.
- After assembling the instruction or constant, the assembler increments the location counter by the length of the assembled data to indicate the next available location.
Here is an example of the application of these rules:
Location in Source
Hexadecimal Statements
000004 DONE DC CL3'ABC'
000007 BEFORE EQU *
000008 DURING DC F'200'
00000C AFTER EQU *
000010 NEXT DS D
You can specify multiple location counters for each control section in a source module; for more details about the location counter setting in control sections, see Location counter setting.