Instruction
Instruction
o Rd = Destination register
Rd = Rn - Rm - (1 - CarryFlag) //**It subtracts the value in Rm and the inverse of the carry flag
(i.e., it includes borrow) from Rn.**//
It’s typically used for multi-word subtraction, where subtraction carries over from previous word
operation.
If C = 1: Rd = Rn - Rm
If C = 0: Rd = Rn - Rm - 1
✅ Example:
Let's assume:
R1 = 0x00000005 (5 in decimal)
R0 = 0x00000003 (3 in decimal)
With C = 1:
R7 = R1 - R0 - (1 - C)
R7 = 5 - 3 - (1 - 1)
R7 = 5 - 3 - 0 = 2
So after execution, R7 = 2.