Shifting means to move bits right and left inside an operand. Rotating shifts each bit and copies the shifted-out bit into the lowest bit if rotate left or the highest bit if rotate right.
There are two basic ways to shift bits in a number:
|
Command
|
Description
|
SHL |
Shift left |
SHR |
Shift right |
SAL |
Shift arithmetic left |
SAR |
Shift arithmetic right |
ROL |
Rotate left |
ROR |
Rotate right |
RCL |
Rotate carry left |
RCR |
Rotate carry right |
SHLD |
Double-precision shift left |
SHRD |
Double-precision shift right |
|