ror

8086 and later

Rotate Right

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

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 ror 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
ror r/m8, 18086
ror r/m16, 18086
ror r/m32, 1386
ror r/m64, 1x86-64long
ror r/m8, cl8086
ror r/m16, cl8086
ror r/m32, cl386
ror r/m64, clx86-64long
ror r/m8, imm8186
ror r/m16, imm8186
ror r/m32, imm8386
ror r/m64, imm8x86-64long
ror [reg8], r/m8, 1x86-64apxlong
ror [reg16], r/m16, 1x86-64apxlong
ror [reg32], r/m32, 1x86-64apxlong
ror [reg64], r/m64, 1x86-64apxlong
ror [reg8], r/m8, clx86-64apxlong
ror [reg16], r/m16, clx86-64apxlong
ror [reg32], r/m32, clx86-64apxlong
ror [reg64], r/m64, clx86-64apxlong
ror [reg8], r/m8, imm8x86-64apxlong
ror [reg16], r/m16, imm8x86-64apxlong
ror [reg32], r/m32, imm8x86-64apxlong
ror [reg64], r/m64, imm8x86-64apxlong
ror reg32, r/m32, imm8recentbmi2
ror reg64, r/m64, imm8x86-64bmi2long