1.1.6 Using Bit Fields

A bit field declaration assigns a single variable name to a group of bits. After making a bit field assignment using the FIELD keyword, the name can be used in an expression; the operation specified in the expression is applied to each bit in the group. When a FIELD statement is used, the compiler generates a single 32-bit field internally. This field is used to represent the variables in the bit field, with each bit representing one member of the bit field. The bit number that represents a member of a bit field is the same as the index number when indexed variables are used. This means that A0 will always occupy bit 0 in the bit field. Bit fields are mainly used for defining and manipulating address and data buses.

Figure 1-1. Using the FIELD Statement
FIELD ADDRESS = [A7, A6, A5, A4, A3, A2, A1, A0];

FIELD DATA = [D7..D0];

FIELD Mode = [Up, Down, Hold];