gc80c520a CORERIVER Semiconductor, gc80c520a Datasheet - Page 152

no-image

gc80c520a

Manufacturer Part Number
gc80c520a
Description
Midas1.0 Family Mask Rom/eprom/romless 8-bit Turbo Microcontrollers
Manufacturer
CORERIVER Semiconductor
Datasheet
Instruction Set
SUBB
A, <src-byte>
Subtract with borrow
Function:
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
Example:
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 0C9h (11001001b), register 2 holds 54h (01010100b),
and the carry flag is set. The instruction,
SUBB A, R2
Preliminary
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 carry (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
Bytes:
1
1
Cycles:
Encoding:
1
0
0
1
1
r
r
r
SUBB
Operation:
(A)
(A) – (C) – (Rn)
Page 152 of 187

Related parts for gc80c520a