Bit (n) is a bit-string variable where n is an integer valued expression that specifies the length of the string value held by the variable. Bit (n) is a sequence of binary digits (bits) that always occupies exactly n bits of storage.
If the high-order bit of the bit-string does not occur on a byte boundary, the remaining bits in the last byte might be part of another bit-string variable. Within each byte, the bits of the string are stored from the low-order to the high-order bit position. Note the bit positions are zero-relative similar to the hardware bit-numbering. For example, Bit (23) would be stored as follows:
If the low-order bit of the bit-string does not occur on a byte boundary, the remaining bits in the last byte might be part of another bit-string variable. Within each byte, the bits of the string are stored from the low-order to the high-order bit position. Note the bit positions are zero-relative similar to the hardware bit-numbering. For example, Bit (23) would be stored as follows:
On little-endian platforms, bit-strings are essentially stored "right-to-left" according the Intel hardware bit-ordering, but all bit operations are performed according to PL/I language semantics.