HLASM Language Reference
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


CXD instruction

HLASM Language Reference
SC26-4940-06

The CXD instruction reserves a fullword area in storage. The linker or loader inserts into this area the total length of all external dummy sections specified in the source modules that are assembled and linked into one program. If a control section has not previously been established, CXD initiates an unnamed (private) control section.
Read syntax diagramSkip visual syntax diagram
>>-+--------+--CXD---------------------------------------------><
   '-symbol-'        

symbol
Is one of the following:
  • An ordinary symbol
  • A variable symbol that has been assigned a character string with a value that is valid for an ordinary symbol
  • A sequence symbol

The linker or loader inserts into the fullword-aligned fullword area reserved by the CXD instruction the total length of storage required for all the external dummy sections specified in a program. If the GOFF assembler option is specified, CXD returns the length of the B_PRV class. If symbol denotes an ordinary symbol, the ordinary symbol represents the address of the fullword area. The ordinary symbol denoted by symbol has a length attribute value of 4.

These examples show how external dummy sections can be used:

ROUTINE A
ALPHA    DXD     2DL8
BETA     DXD     4FL4
OMEGA    CXD
         .
         .
         DC      Q(ALPHA)
         DC      Q(BETA)
         .
         .
ROUTINE B
GAMMA    DXD     5D
DELTA    DXD     10F
ZETA     DXD     XL22
         .
         .
         DC      Q(GAMMA)
         DC      Q(DELTA)
         DC      Q(ZETA)
         .
         .
ROUTINE C
EPSILON  DXD     4H
ZETA     DXD     4F
         .
         .
         DC      Q(EPSILON,ZETA)
         .
         .

Each of the three routines is requesting an amount of work area. Routine A wants 2 doublewords and 4 fullwords; Routine B wants 5 doublewords, 10 fullwords, and 22 bytes; Routine C wants 4 halfwords and 4 fullwords. During program linking, identically named dummy sections are combined, retaining their strictest alignment and longest length. For example, Routines B and C both request storage named ZETA: the resulting allocation is 22 bytes on a fullword boundary. When program linking is complete, the sum of these individual dummy external section lengths is placed in the location of the CXD instruction labeled OMEGA. Routine A can then allocate the amount of storage that is specified in the CXD location, and each dummy external section's offset within the allocated storage is found in the Q-type offset constant referencing its name. Q-type offset constants are described at Offset constant—Q.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014