2.6.3.4 Shift Operations

Register shift operations move the bits in a register left or right by a specified number of bits, the shift length. Register shift can be performed:

  • directly by the instructions ASR, LSR, LSL, ROR, and RRX, and the result is written to a destination register
  • during the calculation of Operand2 by the instructions that specify the second operand as a register with shift, refer to 2.6.3.3 Flexible Second Operand. The result is used by the instruction.

The permitted shift lengths depend on the shift type and the instruction, refer to the individual instruction description or 2.6.3.3 Flexible Second Operand. If the shift length is 0, no shift occurs. Register shift operations update the carry flag except when the specified shift length is 0. The following sub-sections describe the various shift operations and how they affect the carry flag. In these descriptions, Rm is the register containing the value to be shifted, and n is the shift length.