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

A-: 20
To minimize storage space, avoid base types that are small subranges that
overlap byte pair boundaries.
Example
VAR
s : SET OF 31..32;
The set s takes two byte pairs, using 32 bits to represent a set that
requires only two bits. The arithmetic is:
floor(32/16) - floor31/16) + 1 = (2-1)+1 = 2.
Strings.
The Pascal/V packing algorithm aligns strings on 2-byte boundaries.
Because the current length (0..32767) is allocated two bytes, four bytes
is the smallest possible string allocation.
The formula for the number of bytes allocated to a string is: