Groups code or data into a control section (csect) and gives that csect a name, a storage mapping class, and an alignment.
| .csect | QualName[,Number] |
where QualName = [Name][[StorageMappingClass]]
Note: The boldfaced brackets containing StorageMappingClass are part of the syntax and do not specify an optional parameter.
The following information discusses using the .csect pseudo-op:
symbol[XX]
OR
symbol{XX}where either the [ ] (square brackets) or { } (curly brackets) surround a two- or three-character storage mapping class identifier. Both types of brackets produce the same results.
The QualName parameter can be omitted. If it is omitted, the csect is unnamed and the [PR] StorageMappingClass is used. If a QualName is used, the Name parameter is optional and the StorageMappingClass is required. If no Name is specified, the csect is unnamed.
Each control section has a storage mapping class associated with it that is specified in the qualification part of QualName. The storage mapping class determines the object data section, specifically the .text, .data, or .bss section, in which the control section is grouped. The .text section contains read-only data. The .data and .bss sections contain read/write data.
The storage mapping class also indicates what kind of data should be contained within the control section. Many of the storage mapping classes listed have specific implementation and convention details. In general, instructions can be contained within csects of storage mapping class PR. Modifiable data can be contained within csects of storage mapping class RW.
A csect is associated with one of the following storage mapping classes. Storage mapping class identifiers are not case-sensitive. The storage mapping class identifiers are listed in groups for the .text, .data, and .bss object data sections.
| .bss Section Storage Mapping Classes | |
|---|---|
| BS | BSS class. Identifies a section that contains uninitialized read/write data. |
| UC | Unnamed FORTRAN Common. Identifies a section that contains read/write data.
A csect is one of the following symbol types: |
| ER | External Reference |
| SD | CSECT Section Definition |
| LD | Entry Point - Label Definition |
| CM | Common (BSS) |
However, for a given name, only one csect can be externalized. If two or more csects with the same name are externalized, a run error may occur, since the linkage editor treats the csects as duplicate symbol definitions and selects only one of them to use.
| Number | Specifies an absolute expression that evaluates to an integer value from 0 to 31, inclusive. This value indicates the log base 2 of the desired alignment. For example, an alignment of 8 (a doubleword) would be represented by an integer value of 3; an alignment of 2048 would be represented by an integer value of 11. This is similar to the usage of the Number parameter for the .align pseudo-op. Alignment occurs at the beginning of the csect. Elements of the csect are not individually aligned. The Number parameter is optional. If it is not specified, the default value is 2. |
| QualName | Specifies a Name and StorageMappingClass for the control section. If Name is not given, the csect is identified with its StorageMappingClass. If neither the Name nor the StorageMappingClass are given, the csect is unnamed and has a storage mapping class of [PR]. If the Name is specified, the StorageMappingClass must also be specified. |
The following example defines three csects:
# A csect of name proga with Program Code Storage Mapping Class. .csect proga[PR] lh 30,0x64(5) # A csect of name pdata_ with Read-Only Storage Mapping Class. .csect pdata_[RO]
l1: .long 0x7782 l2: .byte 'a,'b,'c,'d,'e .csect [RW],3 # An unnamed csect with Read/Write
# Storage Mapping Class and doubleword
# alignment.
.float -5
The .comm pseudo-op, .globl pseudo-op, .lcomm pseudo-op, .align pseudo-op.