Bit-wise Operators

Function Key Description
SL Shift Left. Shift the bit pattern in the X register to the left. The left-most bit is preserved in the carry bit variable. The new right-most bit is replaced with a zero.
SR Shift Right. Shift the bit pattern in the X register to the right. The right-most bit is preserved in the carry bit variable. The new left-most bit is replaced with a zero.
ASR Arithmetic Shift Right. Shift the bit pattern in the X register to the right but preserve the left-most (sign) bit. The right-most bit is preserved in the carry bit variable.
RR Rotate Right. Rotate the bit pattern in the X register to the right. The right-most bit is copied to the new left-most position and preserved in the carry bit variable.
RRn Rotate Right "n" times. Rotate the bit pattern in the Y register to the right the number of times indicated by the value of the X register. The right-most bits are copied to new left-most positions. The carry bit contains the last right-most bit rotated.
RRC Rotate Right with Carry. Rotate the bit pattern in the X register to the right and include the carry bit (between the left-most and right-most positions). The right-most position is preserved in the carry bit variable.
RRCn Rotate Right with Carry "n" times. Rotate the bit pattern in the Y register to the right (including the carry bit) the number of times indicated by the value of the X register. The carry bit contains the last right-most bit rotated.
RL Rotate Left. Rotate the bit pattern in the X register to the left. The left-most bit is copied to the new right-most position and preserved in the carry bit variable.
RLn Rotate Left "n" times. Rotate the bit pattern in the Y register to the left the number of times indicated by the value of the X register. The left-most bits are copied to new right-most positions. The carry bit contains the last right-most bit rotated.
RLC Rotate Left with Carry. Rotate the bit pattern in the X register to the left and include the carry bit (between the left-most and right-most positions). The left-most position is preserved in the carry bit variable.
RLCn Rotate Left with Carry "n" times. Rotate the bit pattern in the Y register to the left (including the carry bit) the number of times indicated by the value of the X register. The carry bit contains the last left-most bit rotated.
MASKR Mask Right. Create a right justified bit-wise mask. The number of bits in the mask is the value of the X register.
MASKL Mask Left. Create a left justified bit-wise mask. The number of bits in the mask is the value of the X register.
LJ Left Justify.  Move the bit pattern to the left most position within the current word size.  The number of positions shifted is the value of the X register.  The resulting number is the value of the Y register.
SB Set Bit. Set a bit to 1 in the value of the Y register. The number of the bit to set is the value of the the X register. The answer is returned in the X register.
CB Clear Bit. Clear a bit (set to 0) in the value of the Y register. The number of the bit to clear is the value of the X register. The answer is returned in the X register.
#B Sum Bits. Perform a summation of the number of set (value of 1) bits in the value of the X register. Returns the answer in the X register.