EasyManua.ls Logo

Intel 8080 - B1_Page_21

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
1.
Assembly
language
and
Processors
indicates a positive value; a one indicates a negdtive v,ilue. This value i, duplicated
in
the sign
fldg
so
thdt
conditional jump, cdll,
and return instr"uctiollS can test
fm
positive and negative
value'>.
Zero
Flag
Certain instructions set the zero flag to one to indicate
that
the result
in
the accumulator contains
all
zeros.
These instructions. reset the flag to zero
if
the result
in
the accumulator
is
o~her
than zero. A result
that
has a
carry
and a zero result also sets the zero bit as shown below:
Parity
Flag
1010 0111
+01
01
1001
0000 0000
Carry Flag = 1
Zero Flag
= 1
Parity
is
determined
by
counting the number
of
one bits set
in
the re')ult
in
the dccumuldtor. In'itructiom lhdt
affect the parity flag
set the fldg to
one
fm
even pdrity ,md reset the flag to zero to indicdte odd pdrity.
Auxiliary
Carry
Flag
The auxiliary carry flag indicates a carry
out
of
bit 3
of
the accumulator. You
cannot
test this flag directly
in
your program;
it
is
present to enable the DAA (Decimal Adjust Accumulator) to perform its function.
The auxiliary carry flag
and the DAA
imtruction
allow you to treat the value
in
the
accumulator
a'>
two 4-bit
binary coded decimal numbers. Thus, the vdlue 0001 1001
i'>
equivalent to 19. (If this value
is
interpreted
a'>
d
binary number, it has the value 25.) Notice, however,
that
adding one to this value produces a non·decirn,iI
result:
0001
1001
+0000 0001
000110lD=lA
The DAA instruction converts hexadecimal values such
as
the A
in
the preceding example back
into
binary coded
decimal (BCD)
fmmat.
The DAA instruction requires the auxiliary carry flag since the
BCD
tormat
make'i
it
po'>sible for arithmetic operations to generate a carry from the low-order 4-bit digit into the high·order 4·bit
digit. The DAA performs the following addition to
cmrect
the preceding eXdmple:
0001
10lD
+00000110
0001
0000
+0001
0000
(auxiliary carry)
0010 0000
= 20
1-11

Table of Contents

Related product manuals