EasyManua.ls Logo

Intel 8080 - B3_Page_43

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
4.
Assembler
Directives
When the STKLN directive
is
omitted,
the dssembler provides
it
defdult STKLN
of
tero.
This
i'>
useful when
multiple
pmgrams
Me
bound
together; only one stack will be generated,
so
only one progrdm module need
specify the stack size. However, you
should provide d STKLN if
your
module
i'>
to be te'>ted ,epdrdtely and
uses the stdck.
If
your
program include, more than one STKLN directive, only the
Idst
value
a~,igned
i, retained.
Example:
STKLN
100
ST ACK
and
MEMORY Reserved Words
The
reserved
word,
STACK dnd MEMORY arc not directive'> but dre
of
intere~t
to
programmer,
u~ing
the
relocdtion fedture.
The,e
reserved words arc external reference, whose
dddre"es
Me
supplied by the LOCATE
progrdm.
STACK
is
the symbolic reference to the stdck origin address. You need thi5 dddress to initidli/e the stdck
pointer
regi,ter. AI'll, you can
ba'>e
data <;tructures on this acldress using
~ymbolic
reference5 "uch
dS
STACK+l,
STACK+2, etc.
MEMORY
is
the
~ymbolic
reference to the fir,t byte
of
unused memory Pdst the end
of
your program. AgJin,
you
CJn
base data '>Iluctures on this
addre,>,>
using symbolic references
,uch
a~
MEMORY,
MEMORY+l,
etc.
Programming Tips: Testing Relocatable Modules
The dbility to
te,t
individu.JI program modules
I,
a major advJrttJge
of
moduldr progrJmming. However, mdny
pl'ogrdm module5
dre not logically self-sufficient dnd require
,ome
modificdtion before they
C.ln
be
te,ted.
The
following
is
d
cbcu""ion
of
,ome
of the morc
common
modificdtions thdt may be required.
Initioli/otion Routines
In
most
complete
progldm~,
d number
of
hou~ekeeping
or initidli/dtion
procedure,
Me
performed when
execution
fir,t begins.
If
the progrJm module you dre te,ting relic> on initidlitation procedures ds>igned to a different
module,
you
mu,t
duplicdtc
tho,e
procedul·C's
in
the module to
be
tL''>ted.
(Notice, however,
that
you can link
any
number
of
module,> together
For
te'>ting.)
One
of
the
mo'>\
impurtant
initidi?Jtion
procedures
i"
to set the
'>IJck
pointer. The LOCATE progrdm determine,>
the origin
of
the '>lack.
Your program should
include the following in'>truction to initialize the stack pointer:
LXI
SP,STACK
4-19

Table of Contents

Related product manuals