Reference control sections

A reference control section is one you initiate by using the DSECT, COM, or DXD instruction, as follows:

At assembly time, reference control sections are not assembled into object code. You can use a reference control section either to reserve storage areas or to describe data to which you can refer from executable control sections. These reference control sections are considered empty at assembly time, and the actual binary data to which they refer is not available until execution time.

Dummy control sections

A dummy control section is a reference control section that describes the layout of data in a storage area without actually reserving any virtual storage.

You may want to describe the format of an area whose storage location is not determined until the program is run. You can do so by describing the format of the area in a dummy section, and using symbols defined in the dummy section in the operands of machine instructions.

The DSECT instruction initiates a dummy control section or indicates its continuation. For more information about the DSECT instruction, see DSECT instruction.

How to use a dummy control section

A dummy control section (dummy section) lets you write a sequence of assembler language statements to describe the layout of data located elsewhere in your source module. The assembler produces no object code for statements in a dummy control section, and it reserves no storage in the object module for it. Rather, the dummy section provides a symbolic format that is empty of data. However, the assembler assigns location values to the symbols you define in a dummy section, relative to its beginning.

Therefore, to use a dummy section, you must:

You can then refer to the data symbolically by using the symbols defined in the dummy section.

Common control sections

A common control section is a reference control section that lets you reserve a storage area that can be used by one or more source modules. One or more common sections can be defined in a source module.

The COM instruction initiates a common control section, or indicates its continuation. For more information about the COM instruction, see COM instruction.

How to use a common control section

A common control section (common section) lets you describe a common storage area in one or more source modules.

When the separately assembled object modules are linked as one program, the required storage space is reserved for the common control section. Thus, two or more modules may share the common area.

Only the storage area is provided; the assembler does not assemble the source statements that make up a common control section into object code. You must provide the data for the common area at execution time.

The assembler assigns locations to the symbols you define in a common section relative to the beginning of that common section. This lets you refer symbolically to the data that is placed in the common section at execution time. If you want to refer to data in a common control section, you must establish the addressability of the common control section in each source module that contains references to it. If you code identical common sections in two or more source modules, you can communicate data symbolically between these modules through this common section.

Communicating with modules in other languages

Some high-level languages such as COBOL, PL/I, C, and FORTRAN use common control sections. This lets you communicate between assembler language modules and modules written in those languages.

External dummy sections

An external dummy section is a reference control section that lets you describe storage areas for one or more source modules, to be used as:

Note: External dummy sections are also called "pseudo-registers" in other contexts.

When the assembled object modules are linked and loaded, you can dynamically allocate the storage required for all your external dummy sections at one time from one source module (for example, by using the z/OS GETMAIN macro instruction). This is not only convenient, but it saves space and reduces fragmentation of virtual storage.

Typical bind-time processing of external dummy sections involves "merging" the attributes of identically-named external dummy sections, retaining only the longest length and strictest alignment. In particular, the lengths of identically-named external dummy sections are not additive.

To generate and use the external dummy sections, you need to specify a combination of the following:

For more information about the DXD and CXD instructions, see DXD instruction and CXD instruction.

Note: The names of dummy external control sections may match the names of other external symbols that are not names of dummy control sections, without conflict.

Generating an external dummy section

An external dummy section is generated when you specify a DXD instruction, or when you specify a DSECT instruction whose name appears in a Q-type address constant.

When a DSECT name is used as an operand of a Q-type address constant, that name becomes an external symbol with type XD. The name must satisfy the name-length requirements of the object file format specified in the assembler options.

DXD names may match the names of other types of external symbols without conflict.

Use the Q-type address constant to reserve storage for the offset to the external dummy section whose name is specified in the operand. This offset is the distance in bytes from the beginning of the area allocated for all the external dummy sections to the beginning of the external dummy section specified. You can use this offset value to address the external dummy section.

Using external dummy sections

To use an external dummy section, you must do the following:

  1. Identify and define the external dummy section. The assembler computes the length and alignment required. The linker will merge this definition with other definitions of the same name, assigning the longest length and strictest alignment.
  2. Provide a Q-type constant for each external dummy section defined.
  3. Use the CXD instruction to reserve a fullword area into which the linker or loader inserts the total length of all the external dummy sections that are specified in the source modules of your program. The linker computes this length from the accumulated lengths of the individual external dummy sections supplied by the assembler.
  4. Allocate a storage area using this computed total length.
  5. Load the address of the allocated area into a register.
  6. Add to the address in the register the offset into the allocated area of the applicable external dummy section. The linker inserts this offset into the area reserved by the associated Q-type address constant.
  7. Establish the addressability of the external dummy section in combination with the portion of the allocated area reserved for the external dummy section.

You can now refer symbolically to the locations in the external dummy section. Note that the source statements in an external dummy section are not assembled into object code. Thus, you must create the data described by external dummy sections at execution time.

Note: During linking, external dummy sections may be arranged in any order. Do not assume any ordering relationship among external dummy sections.


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