ROL shifts the bits of the destination to the left by the number of bit positions specified in the count operand. As bits are transferred out the left (high-order) end of the destination, they re-enter on the right (low-order) end. The carry flag (CF) is updated to match the last bit shifted out of the left end.
The shift is repeated the number of times indicated by the second operand, which is either an immediate 8-bit value (max. 1 on the 8086 processor) or the contents of the CL register. To reduce the maximum execution time, the 80186+ uses only the lower 5 bits of the count, limiting the count value to 31; the 8086 uses all 8 bits of count.
If the count operand is not an immediate 1, the overflow flag (OF) is undefined; otherwise ROL sets OF to 0 if destination's sign bit was not changed by the operation, to 1 if the sign bit was changed.
Opcode Format C0 /0 ib ROL r/m8,imm8 C1 /0 ib ROL r/m16,imm8 C1 /0 ib ROL r/m32,imm8 D0 /0 ROL r/m8,1 D1 /0 ROL r/m16,1 D1 /0 ROL r/m32,1 D2 /0 ROL r/m8,CL D3 /0 ROL r/m16,CL D3 /0 ROL r/m32,CL