ARM Instruction Reference

ASR

Arithmetic shift right by n bits divides the value contained in Rm by 2n, if the contents are regarded as a two’s complement signed integer. The original bit[31] is copied into the left-hand n bits of the register.

LSR and LSL

Logical shift right by n bits divides the value contained in Rm by 2n, if the contents are regarded as an unsigned integer. The left-hand n bits of the register are set to 0.

Logical shift left by n bits multiplies the value contained in Rm by 2n, if the contents are regarded as an unsigned integer. Overflow may occur without warning. The right-hand

nbits of the register are set to 0.

ROR

Rotate right by n bits moves the right-hand n bits of the register into the left-hand n bits of the result. At the same time, all other bits are moved right by n bits (see Figure 4-1).

31

Carry

Flag 1 0

...

Figure 4-1 ROR

RRX

Rotate right with extend shifts the contents of Rm right by one bit. The carry flag is copied into bit[31] of Rm (see Figure 4-2 on page 4-26).

The old value of bit[0] of Rm is shifted out to the carry flag if the S suffix is specified (see The carry flag on page 4-26).

ARM DUI 0068B

Copyright © 2000, 2001 ARM Limited. All rights reserved.

4-25

Page 135
Image 135
ARM VERSION 1.2 manual LSR and LSL, Bits of the register are set to