
BASIC INSTRUCTION SET
3.4.2.2 ROTATE INSTRUCTIONS
Rotate instructions allow bits in bytes and words to be rotated. Bits rotated out of an operand are not lost as in a shift, but are "circled" back into the other "end" of the operand.
Rotates affect only the carry and overflow flags. CF may act as an extension of the operand in two of the rotate instructions, allowing a bit to be isolated and then tested by a conditional jump instruction (JC or 1NC). CF always contains the value of the last bit rotated out, even if the instruction does not use this bit as an extension of the rotated operand.
In
ROL (Rotate Left) rotates the byte or word destination operand left by one or by the number of bits specified in the count operand (an immediate value or the value contained in CL). For each rotation specified, the
Example: ROL AL, 8. Rotates the contents of AL left by 8 bits. This rotate instruction returns AL to its original state but isolates the
ROR (Rotate Right) rotates the byte or word destination operand right by one or by the number of bits specified in the count operand (an immediate value or the value contained in CL). For each rotation specified, the
1 ,0 10 01, ,1,101, 0101,1, 01 0 10 1
BEFORE ROL
ROL shills the bits In the memory or register operand to the lell by the specified number 01 bit positions. It copies the bit shilled out 01 the lell 01 the operand Into the right 01 the operand. The last bit shilled Into the least slgnilicant bit 01 the operand also appears In CF. This Instruction also operates on byte operands.
G3010B