Syntax: RSB {<cond>}{S} <destination>, <operand1>, <operand2>
Operation: destination = operand two - operand one
Flags: N,Z,C,V
This instruction performs the arithmetic subtraction of its first operand from its second operand, and stores the result in the destination register. It is very similar to SUB.
This is not a waste of an instruction! Operand two can be specified in several different formats, and it is thus much more flexible than operand one. The RSB instruction thus ensures that either of the operands used can be specified using the flexible format allowed by operand two.
Examples:
RSB R0,R0,#0 ; R0 = 0 - R0 (R0 = -R0)
RSB R6,R3,R7,LSL#2 ; R6 = (R7*4) - R3
|
|
|