Fullword
A fullword is a standard unit of data storage on IBM mainframe systems, consisting of four contiguous bytes (32 bits). It is primarily used to store signed binary integer values and is a fundamental data size for many machine instructions and system interfaces within the z/OS environment.
Key Characteristics
-
- Size and Structure: Comprises 32 bits, where the leftmost bit typically serves as the sign bit (0 for positive, 1 for negative), and the remaining 31 bits represent the magnitude in two's complement format.
- Alignment: For optimal performance and to prevent program checks (e.g.,
0C6or0C7abends), fullwords should generally be aligned on a 4-byte boundary in storage. - Value Range: Can represent signed integers from -2,147,483,648 to +2,147,483,647.
- Instruction Set Usage: Many z/Architecture instructions operate directly on fullwords, such as
L(Load Fullword),ST(Store Fullword),A(Add Fullword),S(Subtract Fullword), andM(Multiply Fullword). - COBOL Mapping: In COBOL, a
PIC S9(9) USAGE IS COMPorUSAGE IS COMP-4data item typically maps to a fullword.
Use Cases
-
- Program Counters and Indices: Storing loop counters, array indices, or record counts where the maximum value fits within the 32-bit signed integer range.
- System Call Parameters: Passing integer parameters to z/OS system services or subroutines that expect 32-bit binary values.
- Memory Addresses (31-bit mode): In 31-bit addressing mode, a fullword can hold a complete memory address. In 64-bit mode, it can hold a relative offset or a portion of an address.
- COBOL Binary Data: Declaring binary integer fields in COBOL programs for efficient arithmetic operations, for example:
cobol 01 WS-FULLWORD PIC S9(9) COMP-4 VALUE 0.- Assembler Programming: Defining and manipulating binary data in assembler language using
F(Fullword) orFL(Fullword Literal) declarations.
Related Concepts
Fullwords are part of a hierarchy of binary data sizes, including halfwords (2 bytes) and doublewords (8 bytes), each used for different ranges and purposes. Their proper use is critical for data alignment, which impacts performance and can prevent program checks. In COBOL, COMP and COMP-4 data types directly correspond to fullwords, while in assembler, specific instructions are designed to load, store, and manipulate fullword values, often interacting with general purpose registers which are 64-bits but can operate on 32-bit fullwords.
- Ensure Proper Alignment: Always define