EasyManua.ls Logo

Intel 8080 - B1_Page_25

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
Instruction
Set
The
8080
incorporates a powerful array
of
instructions. This section provides a general overview
of
the instruc-
tion set. The detailed operation
of
each instruction
is
described
in
Chapter 3 of this manual.
Addressing Modes
Instructions can
be
categorized according to their method
of
addressing the hardware registers
and/or
memory.
Implied Addressing. The addressing mode
of
certain instructions
is
implied by the instruction's function. For
example, the
STC (set carry flag) instruction deals only with the carry flag; the DAA (decimal adjust accumu-
lator) instruction deals with the accumulator.
Register Addressing. Quite a large set
of
instructions call for register addre<;sing. With these instructions, you
must specify one
of
the
registers A through
E,
H or L
as
well
as
the operation code. With these instructions,
the
accumulator
is
implied as a second operand. For example,
the
instruction
CMP
E may
be
interpreted
as
'compare the
contents
of
the E register with the
contents
of
the
accumulator.'
Most
of
the instructions that use register addressing deal with 8-bit values. However, a few
of
these instructions
deal with 16-bit register pairs. For example,
the PCHL instruction exchanges the
contents
of
the
program counter
with the
contents
of
the
Hand
L registers.
Immediate Addressing. Instructions
that
use immediate addressing have data assembled
as
a part
of
the instruction
itself. For example, the instruction
CPI
'C' may
be
interpreted
as
'compare the
contents
of
the accumulator with
the
letter c.'
When
assembled, this instruction has the hexadecimal value FE43. Hexadecimal 43
is
the internal
representation for the letter
C.
When this instruction
is
executed, the processor fetches
the
first instruction byte
and determines
that
it must fetch
one
more :lyte. The processor fetches the next byte into one
of
its internal
registers and then performs the compare
ope'ation.
Notice
that
the names
of
the immediate instructions indicate
that
they use immediate data. Thus, the name
of
an
add instruction
is
ADD; the name
of
an
add immediate instruction
is
AD!.
All
but
two
of
the immediate instructions use the accumulator
as
an implied operand,
as
in
the
CPI
instruction
shown previously. The
MVI
(move
immediat'~)
instruction can move its immediate data to any
of
the working
registers, i
ncl
udi
ng
the accu mulator, or to
m<~mory.
Th
us, the instruction
MVI
D
,OF
FH
moves the hexadecimal
value FF to the D register.
The
LXI
instruction (load register pair immediate)
is
even more unu,ual
in
that
its immediate data
is
a 16-bit
value. This instruction
is
commonly
used to load addresses into a register pair.
As
mentioned previously, your
program must initialize the stack pointer;
LXI
i, the instruction most commonly used for this purpose. For ex-
ample, the instruction
LXI
SP,30FFH loads the
,tack
pointer with the hexadecimal value
30FF.
Direct Addressing. Jump instructions include a 16-bit address
as
part
of
the instruction. For example, the
instruction J
MP
1000H causes a jump to the hexadecimal address
1000
by replacing the
current
contents
of
the
program coun ter with the new
val
ue
1000.
1-15

Table of Contents

Related product manuals