HP Pascal/iX Programmer's Guide (31502-90023)

5-: 3
A
packing algorithm
determines a variable's allocation and alignment, and
the allocation and alignment of its elements or fields, if it has them.
The HP Pascal packing algorithm uses the following factors to allocate
and align a particular variable:
* Variable type.
* Whether the variable (if it is an array, record, or set) is
unpacked, packed, or crunched.
When the compiler options TABLES or MAPINFO are ON, the program listing
contains packing information. Refer to the
HP Pascal/iX Reference
Manual
or the
HP Pascal/HP-UX Reference Manual
, depending on your
implementation, for more information on compiler options.
Unpacked Variables
An
unpacked variable
is either not part of an array or record, or it is
part of an unpacked array or record.
Table 5-1 shows how the HP Pascal packing algorithm allocates and
aligns unpacked variables of each HP Pascal type. The variable types are
in alphabetical order. Sections that Table 5-1 references are in
this chapter.
Table 5-1. Allocation and Alignment of Unpacked Variables
(HP Pascal Packing Algorithm)
-------------------------------------------------------------------------------
| | | |
| Variable Type | Allocation | Alignment |
| | | |
-------------------------------------------------------------------------------
| | | |
| Anyptr | 8 bytes | 4-byte |
| | | |
-------------------------------------------------------------------------------
| | |
| Array | See "Arrays" |
| | |
-------------------------------------------------------------------------------
| | | |
| Bit16 | 2 bytes | 2-byte |
| | | |
-------------------------------------------------------------------------------
| | | |
| Bit32 | 4 bytes | 4-byte |
| | | |
-------------------------------------------------------------------------------
| | | |
| Bit52 | 8 bytes | 4-byte |
| | | |
-------------------------------------------------------------------------------
| | | |
| Boolean | 1 byte | Byte |
| | | |
-------------------------------------------------------------------------------
| | | |
| Char | 1 byte | Byte |
| | | |
-------------------------------------------------------------------------------
| | |
| Enumeration | See "Enumerations and Subranges" |
| | |
-------------------------------------------------------------------------------
| | | |
| File | See "Files" | 8-byte |
| | | |
-------------------------------------------------------------------------------