Microprocessor & its Applications
Module 3 Continued……
Dr. Girisha G S
Dept. of CSE
SoE, DSU, Bengaluru
1
Agenda
•Rotate Instructions
-ROL, ROR, RCL, RCR
2
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 ;
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
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