[Robelle] [SmugBook] [Index] [Prev] [Next]

How MPE Describes Bits

Hewlett-Packard computers number bits from left to right with the first bit called Bit 0. Bit 0 is the sign bit, where applicable.

A byte is a unit of 8 bits. When 2 bytes are packed into a 16-bit halfword, the first byte occupies bits 0 through 7 and the second byte occupies bits 8 through 15. When 4 bytes are packed into a 32-bit word, the third byte is bits 16 to 23 and the fourth is bits 24 to 31.

On the Intel 80x86 and DEC VAX, the bits are numbered in the opposite order. See Byte Order in Multi-Byte Values.

SPL and other MPE tools refer to bit strings within a word or halfword using a notation with period and colon.

     word  . (startbit  : number of bits )

For example, mode.(12:2) means bits 12 and 13 of the mode variable, treated as a separate number.


[Robelle] [SmugBook] [Index] [RISC] [Prev] [Next]