3-644
INSTRUCTION SET REFERENCE
SHRDDouble Precision Shift Right (Continued)
Operation
COUNT
<
COUNT MOD 32;
SIZE
<
OperandSize
IF COUNT = 0
THEN
no operation
ELSE
IF COUNT
?
SIZE
THEN (* Bad parameters *)
DEST is undefined;
CF, OF, SF, ZF, AF, PF are undefined;
ELSE (* Perform the shift *)
CF
<
BIT[DEST, COUNT 1]; (* last bit shifted out on exit *)
FOR i
<
0 TO SIZE 1 COUNT
DO
BIT[DEST, i]
<
BIT[DEST, i COUNT];
OD;
FOR i
<
SIZE COUNT TO SIZE 1
DO
BIT[DEST,i]
<
BIT[inBits,i+COUNT SIZE];
OD;
FI;
FI;
Flags Affected
If the count is one or greater, the CF flag is filled with the last bit shifted out of the destination
operand and the SF, ZF, and PF flags are set according to the value of the result. For a 1-bit shift,
the OF flag is set if a sign change occurred; otherwise, it is cleared. For shifts greater than one
bit, the OF flag is undefined. If a shift occurs, the AF flag is undefined. If the count operand is
0, the flags are not affected. If the count is greater than the operand size, the flags are undefined.
Protected Mode Exceptions
#GP(0)
If the destination is located in a nonwritable segment.
If a memory operand effective address is outside the CS, DS, ES, FS, or
GS segment limit.
If the DS, ES, FS, or GS register contains a null segment selector.
#SS(0)
If a memory operand effective address is outside the SS segment limit.
#PF(fault-code)If a page fault occurs.
#AC(0)
If alignment checking is enabled and an unaligned memory reference is
made while the current privilege level is 3.