Ch 5. Allocation and Alignment [ HP Pascal/iX Programmer's Guide ] MPE/iX 5.0 Documentation
HP Pascal/iX Programmer's Guide
Chapter 5 Allocation and Alignment
This chapter:
* Defines allocation, alignment, and packing algorithm.
* Shows how unpacked and packed variables are allocated and aligned.
* Tells how entire arrays and records are allocated and aligned
(whether they are unpacked, packed, or crunched).
* Shows how array elements and record fields are allocated and
aligned when they are unpacked, packed, and crunched.
* Explains how enumeration and subrange types are related and shows
how they are allocated and aligned.
* Explains how files, sets, and strings are allocated and aligned.
NOTE This chapter applies to the HP Pascal packing algorithm, which is
the default. On the MPE/iX operating system, the compiler option
HP3000_16 specifies the Pascal/V packing algorithm instead. For
information on the HP3000_16 compiler option, refer to the HP
Pascal/iX Reference Manual. For information on the Pascal/V
packing algorithm, see Appendix A in this manual.
In diagrams in this section, bold lines are byte boundaries and fine
lines are bit boundaries. Unused bits and bytes are shaded.
Example
Note that:
* Zero represents the Boolean value FALSE, and one represents TRUE.
* The leftmost bit represents the sign of a signed integer value.
Byte boundaries are broken where a variable crosses them. Bit boundaries
are omitted where a variable crosses them. A space that is allocated to
a variable contains the variable's name. If the name does not fit the
space, it is printed outside, with an arrow pointing to the space.
Example
The variables a and b occupy one bit each, c occupies six bits, d and e
occupy two bytes each, f occupies three bytes, and g occupies eight
bytes.
MPE/iX 5.0 Documentation