CRE Programmer's Guide

Math Functions
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
7-24
Return Value
You can manipulate bits in 64-bit operands using the following functions.
bit_string
is a 64-bit bit string that is manipulated by the operator.
mask
is a sequence of bits that is applied to bit_string.
count
specifies the number of bits to shift bit_string.
Return Value
The bit-manipulation functions return the value of bit_string after applying the
specified function—Shift_Left, Shift_Right, Complement, AND, OR, or XOR).
Examples
INT(64) i,
bits := %76543210F;
i := RTL_Shift_Left_Int64_ (bits, 3); ! I = %765432100F
i := RTL_Shift_Right_Int64_(bits, 3); ! I = %007654321F
i := RTL_Complement_Int64_ (bits);
! I = %1777777777777701234567F
INT(64) PROC RTL_Shift_Left_Int64_( bit_string, count );
INT(64) bit_string; ! in
INT count; ! in TNS
only
INT(64) PROC RTL_Shift_Right_Int64_( bit_string, count );
INT(64) bit_string; ! in
INT count; ! in TNS
only
INT(64) PROC RTL_Complement_Int64_( bit_string );
INT(64) bit_string; ! in TNS
only
INT(64) PROC RTL_And_Int64_( bit_string, mask );
INT(64) bit_string, mask; ! in TNS
only
INT(64) PROC RTL_Or_Int64_( bit_string, mask );
INT(64) bit_string, mask; ! in TNS
only
INT(64) PROC RTL_Xor_Int64_( bit_string, mask );
INT(64)bit_string, mask; ! in TNS
only