
Instruction Set
4-225
SHR*
Shift Right
SHR
What It Does
SHR shifts the bits of a component to the right, filling vacant bits with 0s.
Syntax
Description
SHR shifts the bits of the operand downward. SHR shifts the low-order bit into CF. The
effect is to divide the operand by 2. SHR performs an unsigned divide and clears the high-
order bit. The second operand indicates the number of shifts to make. The operand is either
an immediate number or the CL register contents. The processor does not allow shift counts
greater than 31; it only uses the bottom 5 bits of the operand if it is greater than 31.
Operation It Performs
* – Shift immediates were not available on the original 8086/8088 systems.
Form
Opcode
Description
Clocks
Am186 Am188
SHR
r/m8,1
D0
/5
Divide unsigned r/m byte by 2, once
2/15
2/15
SHR
r/m8,CL
D2
/5
Divide unsigned r/m byte by 2, CL times
5+
n/17+n
5+
n/17+n
SHR
r/m8,imm8
C0
/5 ib
Divide unsigned r/m byte by 2, imm8 times
5+
n/17+n
5+
n/17+n
SHR
r/m16,1
D1
/5
Divide unsigned r/m word by 2, once
2/15
2/15
SHR
r/m16,CL
D3
/5
Divide unsigned r/m word by 2, CL times
5+
n/17+n
5+
n/17+n
SHR
r/m16,imm8
C1
/5 ib
Divide unsigned r/m word by 2, imm8 times
5+
n/17+n
5+
n/17+n
SHR
component,count
while (i =
count; i != 0; i--)
/* perform shifts */
{
/* save lowest bit in carry flag */
CF = leastSignificantBit(
component);
/* shift right and fill vacancy with 0 */
component = component >> 1;
}
if (
count == 1)
/* single shift */
OF = temp;
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...