EasyManua.ls Logo

Intel 8080 - B3_Page_11

Intel 8080
224 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SBI
Chapter
3.
Instruction
Sel
Subtract
Memory
from
Accumulator
with
Borrow
Opcode
Operand
SBB
M
This
imtruction
subtracts
the carry flag and the
contents
of
the memory location addres,>ed by the
Hand
L
regi'>ters from the accumulatOl" and stores the result
In
the
accumulator.
Example:
1_1
_0 _0
____
1
01
Cycles:
States:
Addressing:
Flags:
2
7
register i.1direct
Z,S,P,CY,AC
Assume
that
register B
contains
2, the accumulator contains 4, and the carry flag
is
set to
1.
The instruction
SBB
B operate,>
as
follows:
2H
+ carry = 3H
2\
complement
of 3H = 11111101
Ac:urnulator
= 00000100
11111101
00000001 = 1 H
Notice that
thi,
two\
complement
addition
produces a carry When
SBB
complements
the carry bit generated
by the
,Iddition, the carry flag
is
re,et
OFF.
The flag ,>cttings resulting from the
SBB
B
in,truction
arc as
follows:
Carry
0
Sign
0
Zero
0
Parity
0
Aux.
Clrry
SUBTRACT IMMEDIATE WITH BORROW
SBI
,uhtract<, the
contenb
of the second instruction hyte and the
,citing
of the carry flag from the
contents
of
the
accumul,ltor. The result i, stored
in
the
accumulator.
SBI..,
u,e
of the Cdrry flag enables the program to subtract
multi·byte
,tring'>.
SBI
incorpordtes the carry flag by
adding
it
to the
hyte
to he
subtracted
from the accumulator. It then
,ubtrach
the result from the accumulator
by u,ing two's
complement
addition. These preliminary operations occur
in
the proce'>sor\ internal work
regi'>1ers
,0
that
the immediate ,OtIrce dilta
remaim
unchanged.
3-57

Table of Contents

Related product manuals