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

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

At assembly time: High Level Assembler translates the source statements into<br />

object code. Each source module is assembled into one object module. The<br />

| contents of the object module are relocatable.<br />

At linking time: As specified by linker or binder control statements, the linker or<br />

binder combines the object code of one or more sections into one load module or<br />

program object. It also calculates the addresses needed to accommodate common<br />

sections and external dummy sections from different object modules. In addition, it<br />

calculates the space needed to accommodate external dummy sections.<br />

You can specify the relocatable address of the starting point for program execution<br />

| in a linker control statement or request a starting address in the operand field of an<br />

assembler END instruction.<br />

| At program fetch time: The control program loads the load module or program<br />

| object into virtual storage. All the relocatable addresses are converted to fixed<br />

locations in storage.<br />

| At execution time: The control program passes control to the loaded program<br />

now in virtual storage, and your program is run.<br />

| Sections<br />

| In the load module model, control sections may generate machine language text<br />

| containing instructions and data, or define mappings of storage areas to be<br />

| referenced at execution time. Control sections that generate machine language<br />

| text are called executable control sections, even though they may contain only<br />

| data. Control sections that create only mappings are called reference control<br />

| sections.<br />

| In the program object model, sections may define classes containing<br />

| elements. (Classes are described in “Classes (MVS and CMS)” on page 59.)<br />

| Elements may contain machine language text or define mappings, or both.<br />

| Elements may in turn contain one or more parts, which are described at “Parts<br />

| (MVS and CMS)” on page 61.<br />

| Elements containing machine language text are usually linked in a class comprising<br />

| other elements containing machine language text, and elements defining mappings<br />

| are usually linked in a class with other elements defining mappings.<br />

| The section name is used in binder operations to refer to its entire collection of<br />

| elements and parts, but a program object section is not the same as a load module<br />

| control section. A section name may be referenced as an external name only if<br />

| defined as an entry point in an element belonging to that section. (By default, the<br />

| assembler will generate an entry point in class B_TEXT with the section's name.<br />

| See “Classes (MVS and CMS)” on page 59 for more information.)<br />

| The term “executable” is used to describe both executable control sections in the<br />

| load module model, or sections in the program object model.<br />

| You initiate a section by using the START, CSECT, or RSECT instruction, as<br />

described below:<br />

The START instruction can be used to initiate the first or only section of a<br />

source module. For more information about the START instruction, see<br />

“START Instruction” on page 214.<br />

Chapter 3. Program Structures and Addressing 53

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

Saved successfully!

Ooh no, something went wrong!