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.
|
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.
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 may 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 may 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 will resume the first location counter within the CSECT. A CSECT instruction will resume the last location counter used.
| LOCTR name | Effect |
|---|---|
| Section | Resumes assembling with the first location counter of that section |
| Other |
|
| LOCTR 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 |
|
[ Top of Page | Previous Page | Next Page | Contents | Index ]