Bitshift – AMT Datasouth PAL User Manual
Page 66

bitshift
60
bitshift
Description
Shifts the bits of an integer left for positive shift counts, and right for negative shift counts.
Usage
AnyInt ShiftInt
bitshift
ShiftedInt
AnyInt
Integer. Integer value consisting of bits to shift.
ShiftInt
Integer. Distance, in bits, over which to shift the bits of AnyInt. Positive values
for ShiftInt result in left-shifts. Negative values result in right-shifts.
Comments
The interpreter will shift the bits of the specified integer, AnyInt, by the specified number of bits,
ShiftInt. Positive values for ShiftInt instruct the interpreter to shift the bits to the left. Under the
PAL specification, shifting left implies shifting toward the most significant bit of the value.
Negative values for ShiftInt instruct PAL to shift the bits to the right — toward the least significant
bit of the value.
The interpreter always fills any vacated bit positions with zero value bits. Filling with zeroes oc-
curs regardless of the direction of the shift. Therefore, the interpreter always performs an unsigned
shift operation.