3-641
INSTRUCTION SET REFERENCE
SHLDDouble Precision Shift Left (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, SIZE COUNT];
(* Last bit shifted out on exit *)
FOR i
<
SIZE 1 DOWNTO COUNT
DO
Bit(DEST, i)
<
Bit(DEST, i COUNT);
OD;
FOR i
<
COUNT 1 DOWNTO 0
DO
BIT[DEST, i]
<
BIT[SRC, 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.