The LOCTR instruction specifies multiple location counters within
a control section. The assembler assigns consecutive addresses to
the segments of code using one location counter before it assigns
addresses to segments of coding using the next location counter.
>>-symbol--LOCTR-----------------------------------------------><
- symbol
- Is one of the following:
- An ordinary symbol
- A variable symbol that has been assigned a character string with
a value that is valid for an ordinary symbol
By using the LOCTR instruction, you can code your control section
in a logical order. For example, you can code work areas and data
constants within the section of code, using them without having to
branch around them:
A CSECT , See note 1
LR 12,15
USING A,12
.
B LOCTR , See note 2
.
C LOCTR ,
.
B LOCTR , See note 3
.
A LOCTR , See note 4
.
DUM DSECT , See note 1
C LOCTR , See note 5
.
END
LOCTRs are ordered by their definition order. So in the previous
example, the ordering is A, B, and C. When there are statements in
LOCTR groups, the code is generated using currently active USINGs
and then moved to the final location.
Notes: - The first location counter of a section, class, or part is defined
by the name of the START, CSECT, DSECT, RSECT, CATTR, or COM instruction
defining the section.
- The LOCTR instruction defines a location counter.
- The LOCTR continues a previously defined location counter. A
location counter remains in use until it is interrupted by a LOCTR,
CSECT, DSECT, RSECT, or COM instruction.
- A LOCTR instruction with the same name as a control section continues
the first location counter of that section. However, an unnamed
LOCTR cannot be used to continue an unnamed (private code) control
section.
- A LOCTR instruction with the same name as a LOCTR instruction
in a previous control section causes that control section to be continued
using the location counter specified, even though the LOCTR instruction
might follow the definition (or resumption) of a different section.
- To continue a location counter in an unnamed section, a named
location counter must first be specified for the section by a LOCTR
in the unnamed section.
A control section cannot have the same name as a previous LOCTR
instruction. A LOCTR instruction placed before the first control
section definition initiates an unnamed control section before the
LOCTR instruction is processed.
The length attribute of a LOCTR name is 1.
LOCTR instructions do not force alignment; code assembled under
a location counter other than the first location counter of a control
section is assembled starting at the next available byte after the
previous segment.
A LOCTR name can be referenced as an ordinary symbol. If the LOCTR
name does not match a section name, its value is the location counter
value assigned to its first appearance, and it might have arbitrary
alignment and other attributes. If the LOCTR name is also a control
section name, the value assigned is that of the origin of the control
section. So a LOCTR with the same name as the CSECT resumes the first
location counter within the CSECT. A CSECT instruction
resumes the last location counter used.
Table 1. LOCTR behavior
with NOGOFF optionLOCTR name |
Effect |
---|
Section |
Resumes assembling with the first location counter of that
section |
Other |
- If the LOCTR name was previously declared, resumes assembling
with the location counter of that LOCTR group
- If the LOCTR name was not previously declared, begins processing
a new LOCTR group of statements to be assembled following the most
recently processed section or LOCTR group
|
Table 2. LOCTR behavior
with GOFF optionLOCTR name |
Effect |
---|
Section |
Resumes assembling with the first location counter of the element
in the B_TEXT class of that section |
Class |
Not allowed |
Part |
Resumes assembling with the first location counter of the part |
Other |
- If the LOCTR name was previously declared, resumes assembling
with the location counter of that LOCTR group
- If the LOCTR name was not previously declared, begins processing
statements in a new LOCTR group to
be assembled following the most recently processed class, part, or
LOCTR group.
|