6-33
INSTRUCTION SET SUMMARY
The ROL instruction rotates the bits in the operand to the left (toward more significant bit loca-
tions). The ROR instruction rotates the operand right (toward less significant bit locations).
The RCL instruction rotates the bits in the operand to the left, through the CF flag). This instruc-
tion treats the CF flag as a one-bit extension on the upper end of the operand. Each bit which
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 significant 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 6-10. ROL, ROR, RCL, and RCR Instruction Operations
Destination (Memory or Register)
CF
31
0
Destination (Memory or Register)
CF
0
31
Destination (Memory or Register)
CF
31
0
Destination (Memory or Register)
CF
31
0
ROL Instruction
RCL Instruction
RCR Instruction
ROR Instruction