Data Alignment on MPE XL [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation
HP COBOL II/XL Programmer's Guide
Data Alignment on MPE XL
By default, COBOL data is aligned in the following way on MPE XL:
* In the WORKING-STORAGE and FILE sections: level 01 and 77, COMP
or BINARY SYNCHRONIZED, and index data items are 32-bit-aligned.
* In the LINKAGE section, all data items are 8-bit-aligned
(byte-aligned), even if the SYNCHRONIZED clause is specified. The
SYNCHRONIZED clause adds slack bytes so that every synchronized
item is aligned on the same boundary as if the record were in
WORKING-STORAGE.
The SYNC32 control option does not affect the above, because it specifies
the default. The SYNC16 control option affects all sections. Its effect
is the following:
* Level 01 and 77 data items are 32-bit-aligned.
* COMP or BINARY SYNCHRONIZED data items and indexed data items are
16-bit-aligned.
On MPE XL, the HP COBOL II/XL compiler assumes that all data items in the
LINKAGE SECTION are byte-aligned unless the subprogram is compiled with
the control option OPTFEATURES = LINKALIGNED or OPTFEATURES =
LINKALIGNED16. In the first case, it assumes that they are word-aligned;
in the second, halfword-aligned.
MPE/iX 5.0 Documentation