HLASM Language Reference
HLASM Language Reference HLASM Language Reference
Source Module A source module is composed of source statements in the assembler language. You can include these statements in the source module in two ways: You can enter them directly into the file that contains your source program. You specify one or more COPY instructions among the source statements being entered. When High Level Assembler encounters a COPY instruction, it replaces the COPY instruction with a predetermined set of source statements from a library. These statements then become a part of the source module. See “COPY Instruction” on page 122 for more details. Beginning of a Source Module The first statement of a source module can be any assembler language statement, except MEXIT and MEND. You can initiate the first control section of a source module by using the START instruction. However, you can write some source statements before the beginning of the first control statement. See “First Section” on page 54 for more details. End of a Source Module | The END instruction marks the end of a source module. However, you can code | several END instructions; conditional assembly processing can determine which of | several coded or substituted END instructions is to be processed. Also, specifying | the BATCH option allows you to supply more than one source module in a single | input stream; when BATCH is specified, the assembler completes assembling a | source module when an END statement is encountered, and if further statements | are found in the input stream, assembly of a new source module is begun. See | “END Instruction” on page 182 for more details, and HLASM Programmer's Guide | for information about the BATCH option. Conditional Assembly: Conditional assembly processing can determine which of several coded or substituted END instructions is to be processed. | Sections, Elements, and Parts | In the load module model, a control section is the smallest subdivision of a program that can be relocated as a unit. The assembled control sections contain the object code for machine instructions, data constants, and areas. | In the program object model, elements and parts are the smallest subdivisions of a | program that can be relocated as a unit. Sections allow grouping all element and | part contributions under a single name. The assembled sections, elements, and | parts contain the object code for the machine instructions, data, and areas. Consider the concept of a control section at different processing times: | At coding time: You create a control section or an element or part when you write the instructions it contains. In addition, you establish the addressability of | each component within the source module, and provide any symbolic linkages | between components that lie in different source modules. You also write the linker | control statements to combine sections into a load module or program object, and to provide an entry point address for the beginning of program execution. 52 HLASM V1R5 Language Reference
At assembly time: High Level Assembler translates the source statements into object code. Each source module is assembled into one object module. The | contents of the object module are relocatable. At linking time: As specified by linker or binder control statements, the linker or binder combines the object code of one or more sections into one load module or program object. It also calculates the addresses needed to accommodate common sections and external dummy sections from different object modules. In addition, it calculates the space needed to accommodate external dummy sections. You can specify the relocatable address of the starting point for program execution | in a linker control statement or request a starting address in the operand field of an assembler END instruction. | At program fetch time: The control program loads the load module or program | object into virtual storage. All the relocatable addresses are converted to fixed locations in storage. | At execution time: The control program passes control to the loaded program now in virtual storage, and your program is run. | Sections | In the load module model, control sections may generate machine language text | containing instructions and data, or define mappings of storage areas to be | referenced at execution time. Control sections that generate machine language | text are called executable control sections, even though they may contain only | data. Control sections that create only mappings are called reference control | sections. | In the program object model, sections may define classes containing | elements. (Classes are described in “Classes (MVS and CMS)” on page 59.) | Elements may contain machine language text or define mappings, or both. | Elements may in turn contain one or more parts, which are described at “Parts | (MVS and CMS)” on page 61. | Elements containing machine language text are usually linked in a class comprising | other elements containing machine language text, and elements defining mappings | are usually linked in a class with other elements defining mappings. | The section name is used in binder operations to refer to its entire collection of | elements and parts, but a program object section is not the same as a load module | control section. A section name may be referenced as an external name only if | defined as an entry point in an element belonging to that section. (By default, the | assembler will generate an entry point in class B_TEXT with the section's name. | See “Classes (MVS and CMS)” on page 59 for more information.) | The term “executable” is used to describe both executable control sections in the | load module model, or sections in the program object model. | You initiate a section by using the START, CSECT, or RSECT instruction, as described below: The START instruction can be used to initiate the first or only section of a source module. For more information about the START instruction, see “START Instruction” on page 214. Chapter 3. Program Structures and Addressing 53
- Page 22 and 23: Part 1. Assembler Language—Struct
- Page 24 and 25: Language Compatibility Language Com
- Page 26 and 27: Assembler Program Assembler Program
- Page 28 and 29: Relationship of Assembler to Operat
- Page 30 and 31: Coding Made Easier Linkage between
- 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 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 82 and 83: | For executable sections, the loca
- 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
Source Module<br />
A source module is composed of source statements in the assembler language.<br />
You can include these statements in the source module in two ways:<br />
You can enter them directly into the file that contains your source program.<br />
You specify one or more COPY instructions among the source statements<br />
being entered. When High Level Assembler encounters a COPY instruction, it<br />
replaces the COPY instruction with a predetermined set of source statements<br />
from a library. These statements then become a part of the source module.<br />
See “COPY Instruction” on page 122 for more details.<br />
Beginning of a Source Module<br />
The first statement of a source module can be any assembler language statement,<br />
except MEXIT and MEND. You can initiate the first control section of a source<br />
module by using the START instruction. However, you can write some source<br />
statements before the beginning of the first control statement. See “First Section”<br />
on page 54 for more details.<br />
End of a Source Module<br />
| The END instruction marks the end of a source module. However, you can code<br />
| several END instructions; conditional assembly processing can determine which of<br />
| several coded or substituted END instructions is to be processed. Also, specifying<br />
| the BATCH option allows you to supply more than one source module in a single<br />
| input stream; when BATCH is specified, the assembler completes assembling a<br />
| source module when an END statement is encountered, and if further statements<br />
| are found in the input stream, assembly of a new source module is begun. See<br />
| “END Instruction” on page 182 for more details, and <strong>HLASM</strong> Programmer's Guide<br />
| for information about the BATCH option.<br />
Conditional Assembly: Conditional assembly processing can determine which of<br />
several coded or substituted END instructions is to be processed.<br />
| Sections, Elements, and Parts<br />
| In the load module model, a control section is the smallest subdivision of a program<br />
that can be relocated as a unit. The assembled control sections contain the object<br />
code for machine instructions, data constants, and areas.<br />
| In the program object model, elements and parts are the smallest subdivisions of a<br />
| program that can be relocated as a unit. Sections allow grouping all element and<br />
| part contributions under a single name. The assembled sections, elements, and<br />
| parts contain the object code for the machine instructions, data, and areas.<br />
Consider the concept of a control section at different processing times:<br />
| At coding time: You create a control section or an element or part when you<br />
write the instructions it contains. In addition, you establish the addressability of<br />
| each component within the source module, and provide any symbolic linkages<br />
| between components that lie in different source modules. You also write the linker<br />
| control statements to combine sections into a load module or program object, and<br />
to provide an entry point address for the beginning of program execution.<br />
52 <strong>HLASM</strong> V1R5 <strong>Language</strong> <strong>Reference</strong>