Datasheet

www.ti.com
Instruction Set
3.4.6.46 SUB
SUB[.W] Subtract source from destination
SUB.B Subtract source from destination
Syntax SUB src,dst or SUB.W src,dst
SUB.B src,dst
Operation dst + .NOT.src + 1 dst
or
[(dst - src dst)]
Description The source operand is subtracted from the destination operand by adding the source
operand's 1s complement and the constant 1. The source operand is not affected. The
previous contents of the destination are lost.
Status Bits N: Set if result is negative, reset if positive
Z: Set if result is zero, reset otherwise
C: Set if there is a carry from the MSB of the result, reset otherwise.
Set to 1 if no borrow, reset if borrow.
V: Set if an arithmetic overflow occurs, otherwise reset
Mode Bits OSCOFF, CPUOFF, and GIE are not affected.
Example See example at the SBC instruction.
Example See example at the SBC.B instruction.
NOTE: Borrow Is Treated as a .NOT.
The borrow is treated as a .NOT. carry: Borrow Carry bit
Yes 0
No 1
109
SLAU144JDecember 2004Revised July 2013 CPU
Submit Documentation Feedback
Copyright © 2004–2013, Texas Instruments Incorporated