You copied the Doc URL to your clipboard.

RSC

Reverse Subtract with Carry.

RSC{S}{ cond } { Rd }, Rn , Operand2

where:

S

is an optional suffix. If S is specified, the condition flags are updated on the result of the operation.

cond

is an optional condition code.

Rd

is the destination register.

Rn

is the register holding the first operand.

Operand2

is a flexible second operand.

Usage

The RSC instruction subtracts the value in Rn from the value of Operand2. If the carry flag is clear, the result is reduced by one.

You can use RSC to synthesize multiword arithmetic.

In certain circumstances, the assembler can substitute one instruction for another. Be aware of this when reading disassembly listings.

Use of PC and SP in Thumb instructions

You cannot use PC (R15) for Rd , or any operand.

You cannot use SP (R13) for Rd , or any operand.

Use of PC and SP in ARM instructions

You cannot use PC for Rd or any operand in an RSC instruction that has a register-controlled shift.

Use of PC for any operand in RSC instructions without register-controlled shift, is deprecated.

If you use PC (R15) as Rn or 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, see the SUBS pc,lr instruction.

Use of SP in RSC ARM instructions is deprecated.

Note

The deprecation of SP and PC in ARM instructions is only in ARMv6T2 and above.

Condition flags

If S is specified, the RSC instruction updates the N, Z, C and V flags according to the result.

Correct example

    RSCSLE  r0,r5,r0,LSL r4     ; conditional, flags set

Incorrect example

    RSCSLE  r0,pc,r0,LSL r4    ; PC not permitted with register 
                               ; controlled shift
Was this page helpful? Yes No