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.

z/VM and z/OS

In the program object model, sections may define classes containing elements. (Classes are described in Classes (z/OS and CMS).) 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 (z/OS and CMS).

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 (z/OS and CMS) for more information.)

End of z/VM and z/OS

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:

A section can also be initiated as an unnamed section, or private code, without using the START, CSECT, or RSECT instruction. For more information, see Unnamed section.

First section

Before you initiate the first section in your source module, you may code only certain instructions. The following information lists those instructions that initiate the first section, and those instructions that may precede the first section.

What must appear before the first section

The ICTL instruction, if specified, must be the first statement in a source module.

*PROCESS statements must precede all other statements in a source module, except the ICTL instruction. There is a limit of 10 *PROCESS statements allowed in a source module. Additional *PROCESS statements are treated as assembler comment statements. See topic *PROCESS statement for a description of the *PROCESS statement.

What can optionally appear before the first executable control section

The instructions or groups of instructions that can optionally be specified before the first executable control section are:

These instructions or groups of instructions belong to a source module, but are not considered part of an executable section.

Instructions that establish the first section

Any instruction that affects the location counter, or uses its current value, establishes the beginning of the first executable section. The instructions that establish the first section include any machine instruction and the following assembler instructions:

CCW      CCW0     CCW1     CNOP    CSECT     CXD
DC       DS       EQU      LOCTR   LTORG     ORG
RSECT    START    USING

CSECT, RSECT, and START start a possibly named control section. The other statements start an unnamed control section.

These instructions are always considered a part of the control section in which they appear.

The statements copied into a source module by a COPY instruction determine whether it initiates the first control section. The PROFILE option causes the assembler to generate a COPY statement as the first statement after any ICTL or *PROCESS statements.

The DSECT, COM, and DXD instructions initiate reference control sections and do not establish the first executable section.

Any instructions copied by a COPY instruction, or generated by the processing of a macro instruction before the first section, must belong to one of the groups of instructions shown above. Any other instructions cause the assembler to establish the first section.

All the instructions or groups of instructions listed above can also appear as part of a section.

If you specify the PROFILE assembler option the assembler generates a COPY statement as the first statement in the assembly after any ICTL or *PROCESS statements. The copy member should not contain any ICTL or *PROCESS statements.

Unnamed section

The unnamed section is an executable section that can be initiated in one of the following two ways:

An unnamed control section is sometimes referred to as private code. Private code sections are sometimes difficult to manage with other system components such as linkers and configuration management tools. Avoiding their use is recommended. (Zero-length private code sections are sometimes ignored or discarded by system linkers.)

All sections should be given names so they can be referred to symbolically:

Unnamed common control sections or dummy control sections can be defined if the name entry is omitted from a COM or DSECT instruction.

If you include an AMODE or RMODE instruction in the assembly and leave the name field blank, you must provide an unnamed control section.


[ Top of Page | Previous Page | Next Page | Contents | Index ]