Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3 Manual page 1630

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 1 REV 2.3:
Table of Contents

Advertisement

RCL/RCR/ROL/ROR-—Rotate (Continued)
Description
Shifts (rotates) the bits of the first operand (destination operand) the number of bit
positions specified in the second operand (count operand) and stores the result in the
destination operand. The destination operand can be a register or a memory location;
the count operand is an unsigned integer that can be an immediate or a value in the CL
register. The processor restricts the count to a number between 0 and 31 by masking
all the bits in the count operand except the 5 least-significant bits.
The rotate left (ROL) and rotate through carry left (RCL) instructions shift all the bits
toward more-significant bit positions, except for the most-significant bit, which is
rotated to the least-significant bit location. The rotate right (ROR) and rotate through
carry right (RCR) instructions shift all the bits toward less significant bit positions,
except for the least-significant bit, which is rotated to the most-significant bit location.
The RCL and RCR instructions include the CF flag in the rotation. The RCL instruction
shifts the CF flag into the least-significant bit and shifts the most-significant bit into the
CF flag. The RCR instruction shifts the CF flag into the most-significant bit and shifts the
least-significant bit into the CF flag. For the ROL and ROR instructions, the original
value of the CF flag is not a part of the result, but the CF flag receives a copy of the bit
that was shifted from one end to the other.
The OF flag is defined only for the 1-bit rotates; it is undefined in all other cases. For
left rotates, the OF flag is set to the exclusive OR of the CF bit (after the rotate) and the
most-significant bit of the result. For right rotates, the OF flag is set to the exclusive OR
of the two most-significant bits of the result.
Operation
SIZE  OperandSize
CASE (determine count) OF
SIZE = 8:
SIZE = 16:
SIZE = 32:
ESAC;
(* ROL instruction operation *)
WHILE (tempCOUNT
DO
tempCF  MSB(DEST);
DEST  (DEST  2)  tempCF;
tempCOUNT  tempCOUNT - 1;
OD;
ELIHW;
CF  tempCF;
IF COUNT = 1
THEN OF  MSB(DEST) XOR CF;
ELSE OF is undefined;
FI;
(* ROR instruction operation *)
WHILE (tempCOUNT
DO
tempCF  LSB(SRC);
4:328
tempCOUNT  (COUNT AND 1FH) MOD 9;
tempCOUNT  (COUNT AND 1FH) MOD 17;
tempCOUNT  COUNT AND 1FH;
0)
0)
Volume 4: Base IA-32 Instruction Reference

Advertisement

Table of Contents
loading

This manual is also suitable for:

Itanium architecture 2.3

Table of Contents