SAB80C517-M16 SIEMENS [Siemens Semiconductor Group], SAB80C517-M16 Datasheet - Page 241

no-image

SAB80C517-M16

Manufacturer Part Number
SAB80C517-M16
Description
8-Bit CMOS Single-Chip Microcontroller
Manufacturer
SIEMENS [Siemens Semiconductor Group]
Datasheet
SUBB
Function:
Description:
Example:
SUBB
Operation:
Encoding:
Bytes:
Cycles:
Semiconductor Group
A, <src-byte>
A,Rn
Subtract with borrow
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.
The accumulator holds 0C9 H (11001001 B ), register 2 holds 54 H (01010100 B ), and
the carry flag is set. The instruction
SUBB
will leave the value 74 H (01110100 B ) in the accumulator, with the carry flag and AC
cleared but OV set.
Notice that 0C9 H minus 54 H is 75 H . 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)
1
1
1 0 0 1
(A) – (C) – (Rn)
A,R2
1 r r r
242
Instruction Set

Related parts for SAB80C517-M16