TAL Reference Manual

Standard Functions
TAL Reference Manual526371-001
14-10
Example of $BITOFFSET Function
Example of $BITOFFSET Function
In this example, $BITOFFSET returns the offset (in bits) of the third occurrence of
substructure AB:
STRUCT a; !Declare structure
BEGIN
INT array[0:40];
STRUCT ab[0:9]; !Declare substructure AB
BEGIN ! with ten occurrences
UNSIGNED(1) flag;
UNSIGNED(15) offset;
END;
END;
INT c;
c := $BITOFFSET (a.ab[2]); !Return offset of third
! occurrence of AB
$BOUNDS Function
The $BOUNDS function is described in Section 15, Privileged Procedures.
$CARRY Function
The $CARRY function checks the state of the carry bit in the environment register and
indicates whether a carry out of the high-order bit position occurred.
Usage Considerations
The carry indicator is bit 9 in the environment register (ENV.K). The carry indicator is
affected as follows:
Operation Carry Indicator
Integer addition On if carry out of bit <0>
Integer subtraction or negation On if no borrow out from bit <0>
INT(32) multiplication and division Always off
Multiplication and division except INT(32) Preserved
SCAN or RSCAN operation On if scan stops on a 0 byte
Array indexing and extended structure
addressing
Undefined
Shift operations Preserved
$CARRY
VST1405.vsd