EasyManua.ls Logo

Intel 8080 - B4_Page_36

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...
Chapter
6.
Programming
Techniques
6-16
5.
Add
the
minuend
digits
58
to
the
accumulator.
Accumulator
=
001110008
58 =
010110008
~
100100008
=
90H
Carry = 0
~
'AuXiliary
Carry
= 1
6. DAA
converts
accumulator
to
96
(since Auxiliary
Carry
= 1) and leaves
carry
flag = 0
indicating
that
a
borrow
occurred.
7. Load
accumulator
with
99H.
8. Add
zero
with
carry
to
accumulator,
leaving
accumulator
=
99H.
9.
Subtract
the
subtrahend
digits
13
from
the
accumulator.
Accumulator
=
100110018
13=111011018
lJl
000011
08
10.
Add
the
minuend
digits
43
to
the
accumulator.
Accumulator
=
100001108
43
=
010000118
~~
110010018
= C9H
Carry
= 0
'AuXiliary
Carry
= 0
11. DAA
converts
accumulator
to
29
and
sets
the
carry
flag'"
1, indicating no
borrow
occurred.
Therefore,
the result
of
subtracting
1362
from
4358
is
2996.
The following
subroutine
will
subtract
one
16-digit decimal
number
from
another
using the following
assumptions:
The
minuend
is
stored
least significant (2) digits first beginning
at
location
MINU.
The
subtrahend
is
stored
least significant (2) digits first beginning
at
location
S8TRA.
The result will be
stored
least significant (2) digits first, replacing
the
minuend.

Table of Contents

Related product manuals