HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

LTORG Instruction If symbol is an ordinary symbol or a variable symbol that has been assigned an ordinary symbol, the ordinary symbol is assigned the value of the address of the | first byte of the literal pool. This symbol is aligned on a boundary specified by the | SECTALGN option, and has a length attribute of 1. If bytes are skipped after the end of a literal pool to achieve alignment for the next instruction, constant, or area, | the bytes are not filled with zeros. If the literal pool includes any items that require | quadword alignment and the SECTALGN value defaults to 8, then the assemble of | the literal causes the issue of an ASMA500W message. The assembler ignores the borders between control sections when it collects literals into pools. Therefore, you must be careful to include the literal pools in the control sections to which they belong (for details, see “Addressing Considerations” on page 195). The creation of a literal pool gives the following advantages: Automatic organization of the literal data into sections that are correctly aligned and arranged so that minimal space is wasted in the literal pool. Assembling of duplicate data into the same area. Because all literals are cross-referenced, you can find the literal constant in the pool into which it has been assembled. Literal Pool A literal pool is created under the following conditions: Immediately after a LTORG instruction. If no LTORG instruction is specified, and no LOCTRs are used in the first control section, a literal pool generated after the END statement is created at the end of the first control section, and appears in the listing after the END statement. If no LTORG instruction is specified, and LOCTRs are used in the first control section, a literal pool generated after the END statement is created at the end of the most recent LOCTR segment of the first section, and appears in the listing after the END statement. To force the literal pool to the end of the control section when using LOCTRs, you must resume the last LOCTR of the CSECT before the LTORG statement (or before the END statement if no LTORG statement is specified). Each literal pool has five segments into which the literals are stored (a) in the order that the literals are specified, and (b) according to their assembled lengths, which, for each literal, is the total explicit or implied length, as described below. | The first segment contains all literal constants whose assembled lengths are a | multiple of 16. The second segment contains those whose assembled lengths are a multiple of 8, but not of 16. The third segment contains those whose assembled lengths are a multiple of 4, but not a multiple of 8. The fourth segment contains those whose assembled lengths are even, but not a multiple of 4. 194 HLASM V1R5 Language Reference

LTORG Instruction The fifth segment contains all the remaining literal constants whose assembled lengths are odd. | Since each literal pool is aligned on a SECTALGN alignment, this guarantees that | all literals in the second segment are doubleword aligned; in the third segment, | fullword aligned; and, in the fourth, halfword aligned. The minimum value of | SECALGN is doubleword, so quadword alignment is not guaranteed. No space is wasted except, possibly, at the origin of the pool, and in aligning to the start of the statement following the literal pool. Literals from the following statements are in the pool, in the segments indicated by the parenthesized numbers: FIRST START . MVC TO,=3F'9' (3) AD 2,=D'7' (2) IC 2,=XL1'8' (5) MVC MTH,=CL3'JAN' (5) LM 4,5,=2F'1,2' (2) AH 5,=H'33' (4) L 2,=A(ADDR) (3) MVC FIVES,=XL16'5' (1) Addressing Considerations If you specify literals in source modules with multiple control sections, you should: Write a LTORG instruction at the end of each control section, so that all the literals specified in the section are assembled into the one literal pool for that section. If a control section is divided and interspersed among other control sections, you should write a LTORG instruction at the end of each segment of the interspersed control section. When establishing the addressability of each control section, make sure (a) that all of the literal pool for that section is also addressable, by including it within a USING range, and (b) that the literal specifications are within the corresponding USING domain. The USING range and domain are described in “USING Instruction” on page 218. All the literals specified after the last LTORG instruction, or, if no LTORG instruction is specified, all the literals in a source module are assembled into a literal pool at the end of the first control section. You must then make this literal pool addressable, along with the addresses in the first control section. This literal pool is printed in the program listing after the END instruction. Duplicate Literals If you specify duplicate literals within the part of the source module that is controlled by a LTORG instruction, only one literal constant is assembled into the pertinent literal pool. This also applies to literals assembled into the literal pool at the end of the first or only control section of a source module that contains no LTORG instructions. Literals are duplicates only if their specifications are identical, not if the object code assembled happens to be identical. Chapter 5. Assembler Instruction Statements 195

LTORG Instruction<br />

The fifth segment contains all the remaining literal constants whose assembled<br />

lengths are odd.<br />

| Since each literal pool is aligned on a SECTALGN alignment, this guarantees that<br />

| all literals in the second segment are doubleword aligned; in the third segment,<br />

| fullword aligned; and, in the fourth, halfword aligned. The minimum value of<br />

| SECALGN is doubleword, so quadword alignment is not guaranteed. No space is<br />

wasted except, possibly, at the origin of the pool, and in aligning to the start of the<br />

statement following the literal pool.<br />

Literals from the following statements are in the pool, in the segments indicated by<br />

the parenthesized numbers:<br />

FIRST START <br />

.<br />

MVC TO,=3F'9' (3)<br />

AD 2,=D'7' (2)<br />

IC 2,=XL1'8' (5)<br />

MVC MTH,=CL3'JAN' (5)<br />

LM 4,5,=2F'1,2' (2)<br />

AH 5,=H'33' (4)<br />

L 2,=A(ADDR) (3)<br />

MVC FIVES,=XL16'5' (1)<br />

Addressing Considerations<br />

If you specify literals in source modules with multiple control sections, you should:<br />

Write a LTORG instruction at the end of each control section, so that all the<br />

literals specified in the section are assembled into the one literal pool for that<br />

section. If a control section is divided and interspersed among other control<br />

sections, you should write a LTORG instruction at the end of each segment of<br />

the interspersed control section.<br />

When establishing the addressability of each control section, make sure (a) that<br />

all of the literal pool for that section is also addressable, by including it within a<br />

USING range, and (b) that the literal specifications are within the corresponding<br />

USING domain. The USING range and domain are described in “USING<br />

Instruction” on page 218.<br />

All the literals specified after the last LTORG instruction, or, if no LTORG instruction<br />

is specified, all the literals in a source module are assembled into a literal pool at<br />

the end of the first control section. You must then make this literal pool<br />

addressable, along with the addresses in the first control section. This literal pool<br />

is printed in the program listing after the END instruction.<br />

Duplicate Literals<br />

If you specify duplicate literals within the part of the source module that is<br />

controlled by a LTORG instruction, only one literal constant is assembled into the<br />

pertinent literal pool. This also applies to literals assembled into the literal pool at<br />

the end of the first or only control section of a source module that contains no<br />

LTORG instructions.<br />

Literals are duplicates only if their specifications are identical, not if the object code<br />

assembled happens to be identical.<br />

Chapter 5. Assembler Instruction Statements 195

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!