x86 Assembly Language Reference Manual

Shift and Rotate Instructions

The shift and rotate instructions shift and rotate the bits in their operands.

Table 3–5 Shift and Rotate Instructions

Solaris Mnemonic 

Intel/AMD Mnemonic 

Description 

Notes 

rcl{bwlq}

RCL

rotate through carry left 

rclq valid only under -xarch=amd64

rcr{bwlq}

RCR

rotate through carry right 

rcrq valid only under -xarch=amd64

rol{bwlq}

ROL

rotate left 

rolq valid only under -xarch=amd64

ror{bwlq}

ROR

rotate right 

rorq valid only under -xarch=amd64

sal{bwlq}

SAL

shift arithmetic left 

salq valid only under -xarch=amd64

sar{bwlq}

SAR

shift arithmetic right 

sarq valid only under -xarch=amd64

shl{bwlq}

SHL

shift logical left 

shlq valid only under -xarch=amd64

shld{bwlq}

SHLD

shift left double 

shldq valid only under -xarch=amd64

shr{bwlq}

SHR

shift logical right 

shrq valid only under -xarch=amd64

shrd{bwlq}

SHRD

shift right double 

shrdq valid only under -xarch=amd64