ROL moves every bit one place to the left, count times, but nothing is lost: the top bit wraps around into bit 0. The same bit is also copied into CF. Rotating a byte 8 times, or a word 16 times, gives back the original value.

+-------------------------+
| |
+- b7 b6 b5 b4 b3 b2 b1 b0 <-+
|
+-> CF
1000 0001 81h
ROL 1 0000 0011 03h, CF = 1

Forms and flags

Register or memory operand; on the 8086 the count is 1 or CL. Rotates change only CF and OF: SF, ZF, PF and AF keep their old values, so you cannot test the result with JZ directly (add TEST if you need that). CF is the bit that wrapped around, which is also the new bit 0. OF is defined only for a count of 1, where it is set if the top bit changed (CF differs from the new top bit).

Idioms

Look at the top bit and keep the value: ROL AL, 1 puts bit 7 into CF for JC, and seven more rotates (or one ROR) restore AL. Swap the two nibbles of a byte with a rotate by 4: MOV CL, 4 then ROL AL, CL. A rotate of a word by 8 swaps its bytes, though XCHG AH, AL is simpler.

Printing a word in hex: rotate by 4 to bring the highest nibble down to the bottom, print it, and repeat four times. After the fourth rotate the register is back as it was.

Prints C0DE
MOV BX, 0C0DEh
MOV CX, 4 ; four hex digits
HEX1:
PUSH CX
MOV CL, 4
ROL BX, CL ; next nibble to the bottom
MOV AL, BL
AND AL, 0Fh
ADD AL, "0"
CMP AL, "9"
JBE DIG1
ADD AL, 7 ; "A".."F"
DIG1:
MOV DL, AL
MOV AH, 02h
INT 21h
POP CX
LOOP HEX1

Later CPUs

The 8086 uses all 8 bits of CL as the count. The 80186 and later keep only the low 5 bits and also accept an immediate count, as in ROL AX, 4.