Bit (n) Aligned

Bit (n) Aligned is a bit-string variable. The ALIGNED attribute causes the bit-string variable for which it is declared to be byte-aligned, resulting in more efficient access. This attribute may also cause the variable to occupy more than n bits, but it does not increase the length of the value that can be stored in the variable. The ALIGNED attribute has no effect on operations performed on the variable, but is considered part of the data type for purposes of argument/parameter matching and storage sharing.

For Intel platforms, using the -bitsltr compiler option stores bit strings as Big-Endian. See -bitsltr in the Compiler Options help topic for more information.

Bit (n) Aligned size is in bytes. If the length, n, is not a multiple of eight (for example, Bit (27) Aligned) then the remaining bits in the last byte are unused. Within each byte, the bits of the string are stored from the high-order to the low-order position. For example, Bit (27) Aligned would be stored as follows:


Bit Aligned

Size Alignment
[(n+7)/8] bytes    byte

On Little Endian platforms, bits are reversed on each byte.