3. Rotate Instructions – ROL, ROR, RCL, RCR
ROL – Rotate Left without carry
Syntax:
ROL Dest, Count
Examples:
Flags Affected: CF, OF
AL = D5H
CF
CF
; AL=ABH
MOV CL, 04
ROL BL,CL
ROL AL,1 ;
4. ROR -Rotate Right without carry
Examples:
ROR AL,1 ; AL=D5H
; AL = EAH
MOV CL, 04
ROR BL,CL
Syntax:
ROR Dest, Count
Flags Affected: CF, OF
CF
C
F
5. RCL – Rotate Through Carry Left
RCR – Rotate Through Carry Right
Syntax:
RCL Dest, Count
Syntax:
RCR Dest, Count
; AL=D5H
; AL=6AH
CF
CF
Examples: RCR AL,1
; AL=D5H
; AL=AAH
Examples: RCL AL,1
Editor's Notes
RCR instruction rotates the bits in
the operand specified by op1 towards right by the count specified in op2.