HLASM Language Reference
HLASM Language Reference HLASM Language Reference
| For executable sections, the location values that appear in the listings depend on | the THREAD option: | If you specify NOTHREAD, the location counter values for each section, | element, or part restart at 0, except possibly those associated with a first | section initiated by a START instruction with a nonzero address. | If you specify THREAD, location counter values do not restart at 0 for each | subsequent section, element, or part. They continue, after suitable alignment, | from the end of the previous section, element, or part. For reference control sections, the location values that appear in the listings always start from 0. You can continue a control section, element, or part that has been discontinued and, thereby, intersperse code sequences from different control sections, elements, or parts. Note that the location values that appear in the listings for such discontiguous sequences are divided into segments that follow from the end of one segment to the beginning of the subsequent segment. The location values, listed for the next defined control section, element, or part, begin after the last location value assigned to the preceding such item. On VSE, or when you specify the NOGOFF assembler option on MVS and CMS, the maximum value of the location counter and the maximum length of a control | section is 2 24 −1, or X'FFFFFF' bytes. If LIST(133) is in force, then the high-order | is shown as zero. When you specify the GOFF assembler option, the maximum value of the location counter and the maximum length of an element or part is 2 31 −1, or X'7FFFFFFF' bytes. Location Counter and Length Limits | The assembler also maintains a length counter for each individually relocatable | component of the program: executable and reference control sections, elements, | and parts. | If any location counter overflows its maximum value, High Level Assembler issues | the severe error message: | ASMA39S Location counter error | and continues assembling with the location counter value “wrapping” around to | zero. | The length of a section, element, or part cannot exceed the maximum allowed | length described above. If the length counter reaches this maximum value, it stays | fixed at that value without an error condition or error message. Exceeding the | length counter will cause overflow of the location counter, producing the ASMA39S | message. | The location counter setting is relative to the beginning of the location it represents, | and the length counter represents the cumulative length of the control section. This | means that the length counter is nearly always greater than the location counter, | and can exceed its maximum value before the location counter. Even if the | location counter overflows, the length counter value may be correct, and 62 HLASM V1R5 Language Reference
Addressing | reassembling with the NOTHREAD option may avoid the location counter overflow | condition. Use of Multiple Location Counters High Level Assembler lets you use multiple location counters for each individual control section. Use the LOCTR instruction (see “LOCTR Instruction” on page 191) to assign different location counters to different parts of a control section. The assembler then rearranges and assembles the coding together, according to the different location counters you have specified: all coding using the first location counter is assembled together, then the coding using the second location counter is assembled together, and so forth. An example of the use of multiple location counters is shown in Figure 19. In the example, executable instructions and data areas have been interspersed throughout the coding in their logical sequence, each group of instructions preceded by a LOCTR instruction identifying the location counter under which it is to be assembled. The assembler rearranges the control section so that the executable instructions are grouped together and the data areas are grouped together. Symbols are not resolved in the order they appear in the source program, but in location counter sequence. SOURCE MODULE LINKED MODULE (shown in source code format) ┌──────────────────────────────────┐ ┌──────────────────────────────────┐ ─┐ │ INST CSECT │ │ │ controlled │ │ LR 12,15 ├──────────────────►│ LR 12,15 │ by INST │ │ USING INST,12 ├──────────────────►│ USING INST,12 │ location │ │ . │ │ . │ counter │ │ . │┌─────────────────►│ TM CODE,X'3' │ │ │ DATA LOCTR ││┌────────────────►│ BM NEWREC │ │ │ INPUTREC DS CL8 ├┼┼───────────┐ │ │ │ │ RECCODE DS CL1 ├┼┼─────────┐ │ │ │ │ control │ . │││ │ │ │ │ ├── section │ INST LOCTR │││ │ │ │ │ │ INST │ TM CODE,X'3' ├┘│ │ │ ├ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ── ─ ┤ │ │ BM NEWREC ├─┘ │ └────►│ INPUTREC DS CL8 │ controlled │ │ . │ └──────►│ RECCODE DS CL1 │ by DATA │ │ DATA LOCTR │ │ . │ location │ │ VAL1 DC F'56' ├──────────────────►│ VAL1 DC F'56' │ counter │ │ VAL2 DC F'84' ├──────────────────►│ VAL2 DC F'84' │ │ │ . │ │ . │ │ │ . │ ├──────────────────────────────────┤ ─┘ │ NEXT CSECT │ │ │ control │ │ │ │ section │ │ │ │ NEXT Figure 19. Use of Multiple Location Counters | The interactions of the LOCTR instruction with sections, classes, and parts is | described at “LOCTR Instruction” on page 191. Addressing This part of the chapter describes the techniques and introduces the instructions that let you use symbolic addresses when referring to instructions and data. You can address code and data that is defined within the same source module, or code and data that is defined in another source module. Symbolic addresses are more meaningful and easier to use than the corresponding object code addresses required for machine instructions. The assembler can convert the symbolic addresses you specify into their object code form. Chapter 3. Program Structures and Addressing 63
- Page 32 and 33: Character Set Compatibility with Ea
- Page 34 and 35: Assembler Language Coding Conventio
- Page 36 and 37: Assembler Language Coding Conventio
- Page 38 and 39: Assembler Language Coding Conventio
- Page 40 and 41: Assembler Language Coding Conventio
- Page 42 and 43: Assembler Language Structure Condit
- Page 44 and 45: Assembler Language Structure Machin
- Page 46 and 47: Assembler Language Structure Condit
- Page 48 and 49: Terms, Literals, and Expressions Te
- Page 50 and 51: Terms, Literals, and Expressions -
- Page 52 and 53: Terms, Literals, and Expressions As
- Page 54 and 55: Terms, Literals, and Expressions Se
- Page 56 and 57: Terms, Literals, and Expressions Fo
- Page 58 and 59: Terms, Literals, and Expressions I
- Page 60 and 61: Terms, Literals, and Expressions Th
- Page 62 and 63: Terms, Literals, and Expressions 1.
- Page 64 and 65: Terms, Literals, and Expressions
- Page 66 and 67: Terms, Literals, and Expressions
- Page 68 and 69: Terms, Literals, and Expressions Th
- Page 70 and 71: | Chapter 3. Program Structures and
- Page 72 and 73: Source Module A source module is co
- Page 74 and 75: The CSECT instruction can be used a
- Page 76 and 77: | in linker control statements for
- Page 78 and 79: This is not only convenient, but it
- Page 80 and 81: | SECT_A CSECT , Define section SEC
- Page 84 and 85: Addressing | The System/390® and z
- Page 86 and 87: Addressing | Parts must always be r
- Page 88 and 89: Addressing Literal Pools ALPHA LR 3
- Page 90 and 91: Addressing If the symbol is the nam
- Page 92 and 93: Addressing External Symbol Dictiona
- Page 94 and 95: Addressing 74 HLASM V1R5 Language R
- Page 96 and 97: Part 2. Machine and Assembler Instr
- Page 98 and 99: General Instructions Chapter 4. Mac
- Page 100 and 101: Input/Output Operations For further
- Page 102 and 103: Branching with Extended Mnemonic Co
- Page 104 and 105: Symbolic Operation Codes variations
- Page 106 and 107: Operand Entries Registers You can s
- Page 108 and 109: Operand Entries “Program Structur
- Page 110 and 111: Operand Entries Format │ Coded or
- Page 112 and 113: Examples of Coded Machine Instructi
- Page 114 and 115: Examples of Coded Machine Instructi
- Page 116 and 117: Examples of Coded Machine Instructi
- Page 118 and 119: Examples of Coded Machine Instructi
- Page 120 and 121: Chapter 5. Assembler Instruction St
- Page 122 and 123: *PROCESS Statement *PROCESS Stateme
- Page 124 and 125: ACONTROL Instruction ►►──
- Page 126 and 127: ACONTROL Instruction FLAG(PAGE0) in
- Page 128 and 129: AINSERT Instruction character_strin
- Page 130 and 131: AMODE Instruction alias_string is t
| For executable sections, the location values that appear in the listings depend on<br />
| the THREAD option:<br />
| If you specify NOTHREAD, the location counter values for each section,<br />
| element, or part restart at 0, except possibly those associated with a first<br />
| section initiated by a START instruction with a nonzero address.<br />
| If you specify THREAD, location counter values do not restart at 0 for each<br />
| subsequent section, element, or part. They continue, after suitable alignment,<br />
| from the end of the previous section, element, or part.<br />
For reference control sections, the location values that appear in the listings always<br />
start from 0.<br />
You can continue a control section, element, or part that has been discontinued<br />
and, thereby, intersperse code sequences from different control sections, elements,<br />
or parts. Note that the location values that appear in the listings for such<br />
discontiguous sequences are divided into segments that follow from the end of one<br />
segment to the beginning of the subsequent segment.<br />
The location values, listed for the next defined control section, element, or part,<br />
begin after the last location value assigned to the preceding such item.<br />
On VSE, or when you specify the NOGOFF assembler option on MVS and CMS,<br />
the maximum value of the location counter and the maximum length of a control<br />
| section is 2 24 −1, or X'FFFFFF' bytes. If LIST(133) is in force, then the high-order<br />
| is shown as zero.<br />
When you specify the GOFF assembler option, the maximum value of<br />
the location counter and the maximum length of an element or part is 2 31 −1, or<br />
X'7FFFFFFF' bytes.<br />
Location Counter and Length Limits<br />
| The assembler also maintains a length counter for each individually relocatable<br />
| component of the program: executable and reference control sections, elements,<br />
| and parts.<br />
| If any location counter overflows its maximum value, High Level Assembler issues<br />
| the severe error message:<br />
| ASMA39S Location counter error<br />
| and continues assembling with the location counter value “wrapping” around to<br />
| zero.<br />
| The length of a section, element, or part cannot exceed the maximum allowed<br />
| length described above. If the length counter reaches this maximum value, it stays<br />
| fixed at that value without an error condition or error message. Exceeding the<br />
| length counter will cause overflow of the location counter, producing the ASMA39S<br />
| message.<br />
| The location counter setting is relative to the beginning of the location it represents,<br />
| and the length counter represents the cumulative length of the control section. This<br />
| means that the length counter is nearly always greater than the location counter,<br />
| and can exceed its maximum value before the location counter. Even if the<br />
| location counter overflows, the length counter value may be correct, and<br />
62 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>