EasyManua.ls Logo

Intel 8080 - B3_Page_37

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
Modular Program Development
Although
'relocatdbility'
may seem
to
be d formidable term, what it really
meam
i,
that
you
Cdn
subdivide d
complex progrdm
into
a
number
c;f smdller, simpler programs.
Thi,
concept
i, best illustrated through the usc
of
an eXdmple. Assume
that
a
microcomputer
program i, to control the spark advance on an
Jutomobile
engine.
This requires the program to
sample the
ambient
air temperdture, engine air intdke
temperature,
coolant
tempera-
ture, manifold vacuum, idle ,ensor, and
throttle
sensor.
Let
us
examine the approaches two different programmers might take to solve this problem. Both programmers
want
to
calculdte the
degr-ee
of
,park
advance or retarddtion
that
provide, the
beq
fuel
economy
with the lowest
emissions. Programmer A codes d single program that '>ense,
all
inputs ,md cdlculdte, the correct
,park
ddvance.
Programmer
Buses
d modular dpproach dnd codes separdte programs for edch input pill, one program to calculate
spark
advance.
Although
Programmer A avoids the need to learn
to
usc the relocatdbility feature, the modular approach used
by
Programmer B has a number
of
advantages you should consider:
Simplified Progrdm Development
It
i, gener,tlly ea'.ier to code,
teq,
dnd debug sev('r,tI simple
program'
tlMn one complex progrdm.
ShMing the Progrdmming T d,k
If
ProgrcHnmer B find., thdt he
i.,
fdlling behind schedule,
he
can
d'>Sign
one
or
more
of
his sub-
progr,lms
to
another
programmer-. Becau,e
of
hi, single program concept, Pro:4rammer A
will
probably hdve to complete the progralll him',clf.
Progrdmmcr B
Ldn
teq
and debug
mo,t
of
hi, modules
.IS
soun as they .Ire as'>cmblcd; Programmer
;\
must
teq
hi" program
as
d whole. Notice
that
Progr,tmmcr B
hJS
,tn extr,t ddvantagc
if
the
,cmOlS ,tre being developed at the
,ame
time
dS
the prograrTl.
If
one
of
the scmor.,
is
behind
schedule, Programmer B can
continue
developltlg ,tnd testing progr,lIn, for till' sensor,
that
dle
ready. Bec.tuse ProgrdmrTler
A Cdnnot
te<"(
hi·,
progrdrTl
until
all
the
)ensor,
ar,.::
developed, his
testing schedule i,
dependent
on events beyond his control.
ProgramrTling Changes
Civen
the
nature
of
automotive
design,
it
is
ICd,onablc to expect
SOrTle
chang.::s during
,y,tem
developrTlent.
If
a change to one
of
the
'>cll)or.,
require., a prugr.lmrTling change,
ProgrdrTlmCr
A
must se.lrch through
hi~
entire program
to
find and .lIter the coding for that ',emor. Then he
rTlust
rete\( the entire prograrTl
to
be certdin that
tho,c
change'. do not affect .lny
of
the
other
semors.
By
contrdst, Progrdllllller B need
be
conccr-ned only with the module for thdt one sensor. This
ddvdnt.tge continucs
throughout
the lifc
()f
the progralll.
4-13

Table of Contents

Related product manuals