English
Language : 

SAB80C517_05 Datasheet, PDF (241/323 Pages) Siemens Semiconductor Group – 8-Bit CMOS Single-Chip Microcontroller
Instruction Set
SUBB A, <src-byte>
Function:
Subtract with borrow
Description:
SUBB subtracts the indicated variable and the carry flag together from the
accumulator, leaving the result in the accumulator. SUBB sets the carry (borrow)
flag if a borrow is needed for bit 7, and clears C otherwise. (If C was set before
executing a SUBB instruction, this indicates that a borrow was needed for the
previous step in a multiple precision subtraction, so the carry is subtracted from the
accumulator along with the source operand). AC is set if a borrow is needed for bit
3, and cleared otherwise. OV is set if a borrow is needed into bit 6 but not into bit 7,
or into bit 7 but not bit 6.
When subtracting signed integers OV indicates a negative number produced when
a negative value is subtracted from a positive value, or a positive result when a
positive number is subtracted from a negative number.
The source operand allows four addressing modes: register, direct, register-
indirect, or immediate.
Example:
The accumulator holds 0C9H (11001001B), register 2 holds 54H (01010100B), and
the carry flag is set. The instruction
SUBB A,R2
will leave the value 74H (01110100B) in the accumulator, with the carry flag and AC
cleared but OV set.
Notice that 0C9H minus 54H is 75H. The difference between this and the above
result is due to the (borrow) flag being set before the operation. If the state of the
carry is not known before starting a single or multiple-precision subtraction, it should
be explicitly cleared by a CLR C instruction.
SUBB A,Rn
Operation:
SUBB
(A) ← (A) – (C) – (Rn)
Encoding:
Bytes:
Cycles:
1001 1rrr
1
1
Semiconductor Group
242