pTAL Conversion Guide

Structures
pTAL Conversion Guide527302-002
11-15
Referral Structure Syntax
PLATFORM
specifies that the structure and the fields of the structure must begin at
addresses that are consistent across all languages on the same architecture.
pTAL allocates such structures according to the rules used by the native mode
HP C compiler for AUTO layouts.
Referral Structure Syntax
The syntax of a pTAL referral structure is the same as in TAL. You cannot specify a
FIELDALIGN clause on a referral structure declaration.
The field alignment of a referral structure is the field alignment of the structure to which
it refers.
NODEFAULT Alignment
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.
Structure Fields
Structure fields can specify the VOLATILE attribute and the REFALIGNED clause. The
syntax and semantics of these two elements are the same as those of simple variables
and pointers.
VOLATILE Attribute
You can specify the VOLATILE attribute on any field except a substructure.
The same syntax and semantics of VOLATILE fields and VOLATILE pointer fields is
the same as those of VOLATILE variables and pointers, respectively:
STRUCT s;
BEGIN
VOLATILE INT a; ! Simple VOLATILE field
VOLATILE INT .EXT b; ! VOLATILE extended pointer
VOLATILE INT .c REFALIGNED(2); ! VOLATILE standard pointer
END; ! with REFALIGNED clause
For more information about: See Section:
Simple VOLATILE variables Section 8, Simple Variables
VOLATILE data and pointers Section 5, Data Allocation
REFALIGNED clause Section 10, Pointers