
BASIC INSTRUCTION SET
111 o 11l'11o 1o 111o 1111111o I o I o I 0
BEFORE RDR
[I o I 1I 1I 0 1I 1 1I o I o I 1 o I 1I 1111010rrG
AFTER RDR BY 1 BIT
rl1 o 11I 1l'o 1o 1o 1111 o 111111101°'TD
AFTER RCR BY 8 BITS_
OPERAND | CF |
ROR shifts the bits In the memory or register operand to the right by the specified number of bit positions. It caples each bit shifted out of the right of the operand Into the left of the operand. The last bit shifted Into the most significant bit of the operand also appears
In CF. This instruction also operates on byte operands.
G30108
Figure 3-10. ROR
Example: ROR WORDOPRND, CL. Rotates the contents of the memory word labeled WORDOPRND by the number of bits specified by the value contained in CL. CF reflects the value of the last bit rotated from the right to the left side of the operand.
RCL (Rotate Through Carry Left) rotates bits in the byte or word destination operand left by one or by the number of bits specified in the count operand (an immediate value or the value contained in CL).
This instruction differs from ROL in that it treats CF as a
Example: RCL BX,l. Rotates the contents of BX left by one bit. The
RCR (Rotate Through Carry Right) rotates bits in the byte or word destination operand right by one or by the number of bits specified in the count operand (an immediate value or the value contained in
CL).
This instruction differs from ROR in that it treats CF as a
Example: RCR BYTEOPRND,3. Rotates the contents of the memory byte labeled BYTEOPRND to the right by 3 bits. Following the execution of this instruction, CF reflects the original value of bit number 5 of BYTEOPRND, and the original value of CF becomes bit 2.