Thumb Instruction Reference

5.3.2ASR, LSL, LSR, and ROR

Shift and rotate operations. These instructions can use a value contained in a register, or an immediate shift value.

Syntax

op Rd, Rs

op Rd, Rm, #expr

where:

 

 

 

 

 

 

 

op

is one of:

 

ASR

 

Arithmetic Shift Right. Register contents are treated as two’s

 

 

 

complement signed integers. The sign bit is copied into

 

 

 

vacated bits.

 

LSL

 

Logical Shift Left. Vacated bits are cleared.

 

LSR

 

Logical Shift Right. Vacated bits are cleared.

 

ROR

 

Rotate Right. Bits moved out of the right-hand end of the

 

 

 

register are rotated back into the left-hand end.

 

 

 

 

Note

 

 

 

 

 

 

 

 

 

 

 

 

ROR can only be used with a register-controlled shift.

 

 

 

 

Rd

is the destination register. It is also the source register for

 

register-controlled shifts. Rd must be in the range r0-r7.

Rs

is the register containing the shift value for register-controlled shifts. Rm

 

must be in the range r0-r7.

Rm

is the source register for immediate shifts. Rm must be in the range r0-r7.

expr

is the immediate shift value. It is an expression evaluating (at assembly

 

time) to an integer in the range:

 

0-31 if op is LSL

 

1-32 otherwise.

5-24

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

ARM DUI 0068B

Page 218
Image 218
ARM VERSION 1.2 manual 2 ASR, LSL, LSR, and ROR