This document discusses four rotate instructions in assembly language programming: ROL and ROR rotate bits left and right by a specified number of positions without affecting the carry flag, while RCL and RCR rotate bits left and right along with the carry flag. All four instructions affect the carry and overflow flags.
1 of 6
Download to read offline
More Related Content
The 8088 instruction set VII - rotate instructions
2. ROL
Meaning Format Operation Flags Affected
Rotate Left ROL D, count Rotate the
destination to the
left by the number
of bit positions
equal to Count.
Each bit rotated
out from the
leftmost bit goes
back into the
rightmost bit
position.
CF, OF
3. ROR
Meaning Format Operation Flags Affected
Rotate Right ROR D, count Rotate the
destination to the
right by the
number of bit
positions equal to
Count. Each bit
rotated out from
the rightmost bit
goes back into the
leftmost bit
position.
CF, OF
4. RCL
Meaning Format Operation Flags Affected
Rotate Left through
carry
RCL D, count Rotate the
destination to the
left by the number
of bit positions
equal to Count.
Carry flag is part
of the rotate.
Each bit rotated
out from the
leftmost bit goes
back into the
rightmost bit
position.
CF, OF
5. RCR
Meaning Format Operation Flags Affected
Rotate Right
through carry
RCR D, count Rotate the
destination to the
right by the
number of bit
positions equal to
Count. Carry flag
is part of the
rotate. Each bit
rotated out from
the rightmost bit
goes back into the
leftmost bit
position.
CF, OF
6. RCR
Meaning Format Operation Flags Affected
Rotate Right
through carry
RCR D, count Rotate the
destination to the
right by the
number of bit
positions equal to
Count. Carry flag
is part of the
rotate. Each bit
rotated out from
the rightmost bit
goes back into the
leftmost bit
position.
CF, OF