pTAL Reference Manual (H06.08+)
Statements
HP pTAL Reference Manual—523746-006
12-9
Bit-Deposit Assignment
Bit-Deposit Assignment
The bit deposit form of the assignment statement lets you assign a value to an
individual bit or to a group of sequential bits.
variable
is the identifier of a STRING or INT variable, but not an UNSIGNED(1-16) variable.
variable can be the identifier of a simple variable, array element, or simple
pointer (inside or outside a structure).
left-bit
is an INT constant that specifies the leftmost bit of the bit deposit field.
For STRING variables, specify a bit number in the range 8 through 15. Bit 8 is the
leftmost bit in a STRING variable; bit 15 is the rightmost bit.
right-bit
is an INT constant specifying the rightmost bit of the bit deposit field. right-bit
must be equal to or greater than left-bit.
For STRING variables, specify a bit number in the range 8 through 15. Bit 8 is the
leftmost bit in a STRING variable; bit 15 is the rightmost bit.
expression
is an INT arithmetic or conditional expression, with or without a bit field
specification.
The bit deposit field is on the left side of the assignment operator (:=). The bit deposit
assignment changes only the bit deposit field. If the value on the right side has more
bits than the bit deposit field, the system ignores the excess high-order bits when
making the assignment.
Specify the variable/bit-field construct with no intervening spaces as shown:
myvar.<0:5>
Do not use bit deposit fields to pack data. Instead, declare an UNSIGNED variable and
specify the appropriate number of bits in the bit field.
variable
. <
left-bit
:
right-bit
>
:=
expression
VST037.vsd










