.lcomm pseudo-op

Purpose

Defines a local uninitialized block of storage.

Syntax

Item Description
.lcomm Name1, Expression1[, Sectname [, Expression2]]

Description

The .lcomm psuedo-op defines a local, uninitialized block of storage. If the Sectname parameter is a QualName operand with a StorageMappingClass class of UL, the storage is for thread-local variables.

The .lcomm pseudo-op is used for data that will probably not be accessed in other source files.

The Name1 parameter is a label at the beginning of the block of storage. The location counter for this block of storage is incremented by the value of the Expression1 parameter. A specific storage block can be specified with the Sectname parameter. If the Sectname parameter is a QualName operand with a StorageMappingClass class of UL, the storage block is assigned to the .tbss section. Otherwise, the storage block is assigned to the .bss section. If Sectname is not specified, an unnamed storage block is used.

The alignment of the storage block can be specified with the Expression2 parameter. If Expression2 is omitted, the block of storage is aligned on a half-word boundary.

Parameters

Item Description
Name1 Label on the block of storage. Name1 does not appear in the symbol table unless it is the operand of a .globl statement.
Expression1 An absolute expression specifying the length of the block of storage.
Sectname Optional csect name. If Sectname is omitted, an unnamed block of storage with a storage-mapping class of BS is used. If Sectname is a QualName, StorageMappingClass can be BS or UL. If Sectname is a symbol name, the default storage-mapping class BS is used. The same Sectname can be used with multiple .lcomm statements. The blocks of storage specified by the .lcomm statements are combined into a single csect.
Expression2 An absolute expression specifying the log base 2 of the desired alignment. If Expression2 is omitted, a value of 2 is used, resulting in a half-word alignment.

Examples

  1. To set up 5KB of storage and refer to it as buffer:
    
    .lcomm buffer,5120
            # Can refer to this 5K
            # of storage as "buffer".
    
  2. To set up a label with the name proga:
    
    .lcomm b3,4,proga
            # b3 will be a label in a csect of class BS
            # and type CM with name "proga".
    
  3. To define a local block of thread-local storage:
    
    .lcomm tls1,32,tls_static[UL],3
            # tls1 is a label on a block of thread-local storage 32 bytes
            # long aligned on a doubleword boundary. The name of the block of
            # storage is tls_static[UL].