Instruction Set - Shifts
ARM610 Data Sheet
4-14
O
The form of the shift field which might be expected to give ROR #0 is used to encode
a special function of the barrel shifter, rotate right extended (RRX). This is a rotate right
by one bit position of the 33-bit quantity formed by appending the CPSR C flag to the
most significant end of the contents of Rm as shown in
·
Figure 4-9: Rotate right
extended
Figure 4-9: Rotate right extended
Register specified shift amount
Only the least significant byte of the contents of Rs is used to determine the shift
amount. Rs can be any general register other than R15.
If this byte is zero, the unchanged contents of Rm will be used as the second operand,
and the old value of the CPSR C flag will be passed on as the shifter carry output.
If the byte has a value between 1 and 31, the shifted result will exactly match that of
an instruction specified shift with the same value and shift operation.
If the value in the byte is 32 or more, the result will be a logical extension of the shift
described above:
1
LSL by 32 has result zero, carry out equal to bit 0 of Rm.
2
LSL by more than 32 has result zero, carry out zero.
3
LSR by 32 has result zero, carry out equal to bit 31 of Rm.
4
LSR by more than 32 has result zero, carry out zero.
5
ASR by 32 or more has result filled with and carry out equal to bit 31 of Rm.
6
ROR by 32 has result equal to Rm, carry out equal to bit 31 of Rm.
7
ROR by n where n is greater than 32 will give the same result and carry out
as ROR by n-32; therefore repeatedly subtract 32 from n until the amount is in
the range 1 to 32 and see above.
The zero in bit 7 of an instruction with a register controlled shift is compulsory; a one
in this bit will cause the instruction to be a multiply or undefined instruction.
Note
1
0
contents of Rm
contents of Rm
value of operand 2
value of operand 2
carry out
carry out
C
in
31
1
0