Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture

7-18 Vol. 1
PROGRAMMING WITH GENERAL-PURPOSE INSTRUCTIONS
The ROL instruction rotates the bits in the operand to the left (toward more signifi-
cant bit locations). The ROR instruction rotates the operand right (toward less signif-
icant bit locations).
The RCL instruction rotates the bits in the operand to the left, through the CF flag.
This instruction treats the CF flag as a one-bit extension on the upper end of the
operand. Each bit that exits from the most significant bit location of the operand
moves into the CF flag. At the same time, the bit in the CF flag enters the least signif-
icant bit location of the operand.
The RCR instruction rotates the bits in the operand to the right through the CF flag.
For all the rotate instructions, the CF flag always contains the value of the last bit
rotated out of the operand, even if the instruction does not use the CF flag as an
extension of the operand. The value of this flag can then be tested by a conditional
jump instruction (JC or JNC).
Figure 7-10. ROL, ROR, RCL, and RCR Instruction Operations
Destination (Memory or Register)CF
31
0
Destination (Memory or Register) CF
031
Destination (Memory or Register)CF
31
0
Destination (Memory or Register) CF
31
0
ROL Instruction
RCL Instruction
RCR Instruction
ROR Instruction