
Instruction Set
4-189
RCR*
Rotate through Carry Right
RCR
What It Does
RCR shifts the bits of a component to the right, copies the Carry Flag (CF) to the highest
bit of the component, and then overwrites CF with the bit shifted out of the component.
Syntax
Description
RCR shifts CF into the top bit and shifts the bottom bit into CF. The second operand (
count)
indicates the number of rotations. The operand is either an immediate number or the CL
register contents. The microcontroller does not allow rotation counts greater than 31. If the
count is greater than 31, only the bottom 5 bits of the operand are rotated.
Operation It Performs
* – Rotate immediates were not available on the original 8086/8088 systems.
Form
Opcode
Description
Clocks
Am186 Am188
RCR
r/m8,1
D0
/3
Rotate 9 bits of CF and r/m byte right once
2/15
2/15
RCR
r/m8,CL
D2
/3
Rotate 9 bits of CF and r/m byte right CL times
5+
n/17+n
5+
n/17+n
RCR
r/m8,imm8
C0
/3 ib
Rotate 9 bits of CF and r/m byte right imm8 times
5+
n/17+n
5+
n/17+n
RCR
r/m16,1
D1
/3
Rotate 17 bits of CF and r/m word right once
2/15
2/15
RCR
r/m16,CL
D3
/3
Rotate 17 bits of CF and r/m word right CL times
5+
n/17+n
5+
n/17+n
RCR
r/m16,imm8
C1
/3 ib
Rotate 17 bits of CF and r/m word right imm8 times
5+
n/17+n
5+
n/17+n
RCR
component,count
while (i =
count; i != 0; i--)
/* perform shifts */
{
/* save lowest bit */
temp = leastSignificantBit(
component);
/* shift right and fill vacancy with carry flag */
component = (component >> 1) + (CF * pow(2, size(component) - 1));
/* replace carry flag with saved bit */
CF = temp;
}
if (
count == 1)
/* single shift */
if (mostSignificantBit(
component) != nextMostSignificantBit(component))
/* set overflow flag */
OF = 1;
else
/* clear overflow flag */
OF = 0;
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...