RRX
Rotate Right with Extend. This instruction is a preferred synonym for MOV
instructions with shifted register operands.
Syntax
RRX
{S
}{
}
cond
,
Rd
Rm
where:
S
is an optional suffix. If S is specified, the condition flags are updated on the result of the operation.
Rd
is the destination register.
Rm
is the register holding the first operand. This operand is shifted right.
Operation
RRX
provides the value of the contents
of a register shifted right one bit. The old carry flag is shifted
into bit[31]. If the S
suffix is present, the
old bit[0] is placed in the carry flag.
Restrictions in T32 code
instructions must not use PC or SP.
Use of SP and PC in A32 instructions
You can use SP in this A32 instruction but this is deprecated.
If you use PC as Rm
, the
value used is the address of the instruction plus 8.
If you use PC as Rd
:
- Execution branches to the address corresponding to the result.
If you use the S suffix, the SPSR of the current mode is copied to the CPSR. You can use this to return from exceptions.
Note
The A32 instructionRRXS{cond} pc,Rm
always disassembles to the preferred formMOVS{
.cond
} pc,Rm{,shift}
Caution
Do not use the S suffix when using PC asRd
in User mode or System mode. The
assembler cannot warn you about this because it has no information about what the processor
mode is likely to be at execution time.You cannot use PC for Rd
or
any operand in this instruction if it has a register-controlled
shift.
Condition flags
If S is specified, the instruction updates the N and Z flags according to the result.
The C flag is unaffected if the shift value is 0. Otherwise, the C flag is updated to the last bit shifted out.
Architectures
The 32-bit instruction is available in A32 and T32.
There is no 16-bit instruction in T32.