HP Pascal/iX Reference Manual (31502-90022)

11- 7
the start of a structured type declaration.
The system programming extensions define a third type of packing in
addition to unpacked and packed, namely CRUNCHED.
The reserved word CRUNCHED indicates that the components of a structured
type (array, record, or set) are allocated contiguously, first to last,
in a bit-aligned fashion with no intervening unused bits. Syntactically,
the word CRUNCHED may be substituted for the word PACKED.
The primary purpose of crunched packing is to provide a map from
data item type to data representation that is independent of the
implementation and the packing algorithm. For that reason, machine
dependent types such as real, longreal, and file are not allowed in
crunched structures.
Example
TYPE
rec = RECORD
a : type_a;
b : type_b;
c : type_c;
END;
crec = CRUNCHED RECORD
a : type_a;
b : type_b;
c : type_c;
END;
In a crunched structure, each component is allocated the minimum number
of bits required to represent that type, and each component is aligned in
such a way that there are no unused bits between it and the previous
component.
The first declaration for rec in the previous example may lead to the
following storage allocation for an arbitrary processor:
Figure 11-3. Layout of a Record
Note that there are unused bits between the fields a and b, and between
the fields b and c.
The crunched record declaration for crec, that is identical to the
uncrunched record rec with the addition of the reserved word CRUNCHED,
would lead to the following storage allocation: