rol

8086 and later

Rotate Left

rol r/m8, 1 | rol r/m16, 1 | rol r/m32, 1 | rol r/m64, 1 | rol r/m8, cl | rol r/m16, cl | rol r/m32, cl | rol r/m64, cl | rol r/m8, imm8 | rol r/m16, imm8 | rol r/m32, imm8 | rol r/m64, imm8 | rol [reg8], r/m8, 1 | rol [reg16], r/m16, 1 | rol [reg32], r/m32, 1 | rol [reg64], r/m64, 1 | rol [reg8], r/m8, cl | rol [reg16], r/m16, cl | rol [reg32], r/m32, cl | rol [reg64], r/m64, cl | rol [reg8], r/m8, imm8 | rol [reg16], r/m16, imm8 | rol [reg32], r/m32, imm8 | rol [reg64], r/m64, imm8 | rol reg32, r/m32, imm_known8 | rol reg64, r/m64, imm_known8

ROL and ROR perform a bitwise rotation operation on the given source/destination (first) operand. Thus, for example, in the operation ROL AL,1, an 8-bit rotation is performed in which AL is shifted left by 1 and the original top bit of AL moves round into the low bit.

The number of bits to rotate by is given by the second operand. Only the bottom five bits of the rotation count are considered by processors above the 8086.

You can force the longer (286 and upwards, beginning with a C1 byte) form of ROL foo,1 by using a BYTE prefix: \c{ROL foo,BYTE 1}. Similarly with ROR.

Loading...

Forms

Every form of rol the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
rol r/m8, 18086
rol r/m16, 18086
rol r/m32, 1386
rol r/m64, 1x86-64long
rol r/m8, cl8086
rol r/m16, cl8086
rol r/m32, cl386
rol r/m64, clx86-64long
rol r/m8, imm8186
rol r/m16, imm8186
rol r/m32, imm8386
rol r/m64, imm8x86-64long
rol [reg8], r/m8, 1x86-64apxlong
rol [reg16], r/m16, 1x86-64apxlong
rol [reg32], r/m32, 1x86-64apxlong
rol [reg64], r/m64, 1x86-64apxlong
rol [reg8], r/m8, clx86-64apxlong
rol [reg16], r/m16, clx86-64apxlong
rol [reg32], r/m32, clx86-64apxlong
rol [reg64], r/m64, clx86-64apxlong
rol [reg8], r/m8, imm8x86-64apxlong
rol [reg16], r/m16, imm8x86-64apxlong
rol [reg32], r/m32, imm8x86-64apxlong
rol [reg64], r/m64, imm8x86-64apxlong
rol reg32, r/m32, imm_known8recentbmi2
rol reg64, r/m64, imm_known8x86-64bmi2long