2.6.5.1.2 Operation
The ADD
instruction adds the value of Operand2 or
imm12
to the value in Rn
.
The ADC
instruction adds the values in
Rn
and Operand2, together with the carry flag.
The SUB
instruction subtracts the value of Operand2 or
imm12
from the value in Rn
.
The SBC
instruction subtracts the value of Operand2 from
the value in Rn
. If the carry flag is clear, the result is reduced by
one.
The RSB
instruction subtracts the value in
Rn
from the value of Operand2. This is useful because of the wide range
of options for Operand2.
Use ADC
and SBC
to synthesize multiword
arithmetic, see 2.6.5.1.5 Multiword Arithmetic Examples.
See also 2.6.4.1 ADR.
ADDW
is equivalent to the
ADD
syntax that uses the imm12
operand.
SUBW
is equivalent to the SUB
syntax that uses the
imm12
operand.