pTAL Reference Manual (H06.03+)

Structures
HP pTAL Reference Manual523746-005
9-20
FIELDALIGN Clause
FIELDALIGN Clause
You use a FIELDALIGN clause in a structure declaration to specify how you want pTAL
to align the fields in the structure. Fields can be aligned for:
FIELDALIGN Compiler Directive
As with the FIELDALIGN clause, the parameters to the FIELDALIGN compiler directive
include SHARED2, SHARED8, PLATFORM, and AUTO. In addition, you can specify
NODEFAULT as the parameter to the FIELDALIGN compiler directive.
You can specify only one FIELDALIGN directive within a compilation, and it must
precede all data, block, and procedure declarations. Only comments, blank lines, and
other directives can precede a FIELDALIGN directive.
The default value of the FIELDALIGN directive is AUTO.
If you specify the FIELDALIGN (NODEFAULT) compiler directive, pTAL requires you to
specify a FIELDALIGN clause on every structure declaration. You might use the
FIELDALIGN (NODEFAULT) directive to ensure that you do not inadvertently omit a
FIELDALIGN clause on any structure.
If you do not specify a FIELDALIGN (NODEFAULT) directive, pTAL does not require
you to specify a FIELDALIGN clause on each structure declaration.
SHARED2 Parameter
Since the SHARED2 parameter is included with both the FIELDALIGN clause and the
FIELDALIGN compiler directive, the following information relates to both usages:
In a SHARED2 structure, all fields must begin at an even-byte address except
STRING fields, which can begin at any byte address, and UNSIGNED fields, which
can begin at any bit address except as follows:
°
An UNSIGNED(1-16) field cannot cross an even-byte address boundary.
°
An UNSIGNED(17-31) field can cross only one even-byte address boundary.
°
An UNSIGNED field that is not preceded by an UNSIGNED field must begin at
an even-byte address.
Access FIELDALIGN Clause
Exclusive, optimized for best resource utilization on each
architecture
FIELDALIGN(AUTO)
Shared between pTAL and TAL programs FIELDALIGN(SHARED2)
Shared by program modules written in different programming
languages and running on the same architecture
FIELDALIGN(PLATFORM)
Shared between TNS, TNS/R, and TNS/E architecture with
optimal performance on TNS/R and TNS/E architecture
FIELDALIGN(SHARED8)