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


COM instruction

HLASM Language Reference
SC26-4940-06

The COM instruction identifies the beginning or continuation of a common control section.
Read syntax diagramSkip visual syntax diagram
>>-+--------+--COM---------------------------------------------><
   '-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 COM instruction can be used anywhere in a source module after the ICTL instruction.

If symbol denotes an ordinary symbol, the ordinary symbol identifies the common control section. If several COM instructions within a source module have the same symbol in the name field, the first occurrence initiates the common section and the rest indicate the continuation of the common section. The ordinary symbol denoted by symbol represents the address of the first byte in the common section, and has a length attribute value of 1.

If symbol is not specified, or if name is a sequence symbol, the COM instruction initiates, or indicates the continuation of, the unnamed common section.

See CSECT instruction for a discussion on the interaction between COM and the GOFF assembler option.

The location counter for a common section is always set to an initial value of 0. However, when an interrupted common control section is continued using the COM instruction, the location counter last specified in that control section is continued.

If a common section with the same name (or unnamed) is specified in two or more source modules, the amount of storage reserved for this common section is equal to that required by the longest common section specified.

The source statements that follow a COM instruction belong to the common section identified by that COM instruction.
Note:
  1. The assembler language statements that appear in a common control section are not assembled into object code.
  2. When establishing the addressability of a common section, the symbol in the name field of the COM instruction, or any symbol defined in the common section, can be specified in a USING instruction.
  3. An AMODE cannot be assigned to a common section.
In the following example, addressability to the common area of storage is established relative to the named statement XYZ.
         .
         .
         L               1,=A(XYZ)
         USING           XYZ,1
         MVC             PDQ(16),=4C'ABCD'
         .
         .
         COM
XYZ      DS              16F
PDQ      DS              16C
         .
         .

A common control section can include any assembler language instructions, but no object code is generated by the assembly of instructions or constants appearing in a common control section. Data can only be placed in a common control section through execution of the program.

If the common storage is assigned in the same manner by each independent assembly, reference to a location in common by any assembly results in the same location being referenced.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014