Revision as of 06:55, 22 December 2011
RSC will subtract one value from another, with Borrow (NOT Carry). As for RSB, the subtraction is performed in reverse, with operand 2 being the value subtracted from.
If the S bit is set (RSCS), the N and Z flags are set according to the result, and the C and V flags are set as follows: C if the result generated a borrow (a not-carry; unsigned underflow); V if the result generated a signed overflow.
RSC is used for multi-word negation. When used with RSB, you can perform 64 bit (etc) calculations.
RSC<suffix> <dest>, <op 1>, <op 2>
dest = op_2 - op_1 - NOT(Carry)
To negate a 64 bit value (held in R0,R1) and write the result to R4,R5; you would:
RSBS R4, R0, #0 SBC R5, R1, #0
The instruction bit pattern is as follows:
|31 - 28||27||26||25||24 - 21||20||19 - 16||15 - 12||11 - 0|
|condition||0||0||I||1 1 1 1||S||op_1||dest||op_2/shift|