HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Location counter

HLASM Language Reference
SC26-4940-06

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:
  1. After an instruction or constant has been assembled, the location counter indicates the next available location.
  2. 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.
  3. 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.
  4. 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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014