View
251
Download
0
Category
Tags:
Preview:
DESCRIPTION
B
Citation preview
\
8080A-Bcsedmputer
erE
80E5 microprocassor is s much impaovcdion of its pcdeccsso., thc 8080A. Th. E0t5
o0 iB chip dlost of thc logic circuiEy forcompotidg lasks lnd for communicatiog
pc.iphqrls, Ho!vcy6, eighl of its bus liqc!; thlt i!
sd.r rdtq! e$Ldeq Ihis chrptir discussrsl0t5 architccole h detarl and illustratcs lcch-
for dcmukiplcxing the bus and gcneradng lhcconnol signals.
I..t ., thc chaptcr dcs.nbcs a typical 80t5.miquomputcr &sigocd with gcn.rel puposc
and VO dcviccsi i! slso illusEstcs rhc bus
i8 signrls in cxcculing an in$ruclion. ln addi.lh. chaptcr includes illustrations of special-
d.vicca such as th. 8155 end 8?55/8355.dair mc.nory maF io thc Intcl SDK-85 system.
tr Draw a logic rchemaric lo g.neriitc flour conuolsrgnals, Ltsrn8 thr 8085 Io/M, 6 and m sig-
nals: 0) M=E!,lR. (2) ),r.Mw-, (3) foR, and(4) IOW-. Explain $e fun('ions of !hcs. co.Eolslgffils.
! List rhc various inlcmal units thal m.k€ up thc8085 archrrccrurE. and explain thcrr fun$ions rn
decodiog and execuriog an instructior.- Draw the block diagram of an 8085-bascd
, thc chlpacr inclu&s a discussion of th.microproccssot aod rtlatcd deviccs, and
th. 80804 with ttr. 8085.
lEogniz. thc furctioos of various pinr of thrD85 micloproccasorErplain fu bus timiogs in fcrchinS an insrudiontorn rlrmory,Erplain how to dcmultiplcx thc AD-Mo bustsidS a latch.
58 MICNOCOMPUIIR'IS'IEMS AND HARDWARE
Descnbe thc E080A MPU in Erms of its compo-
neni dclices. thc 8080A mlcroprocctsoa, tha
8228 sysrem conlroller, and tha 8224 oscillelor.
Lisr rh. f.arures of rhc 8085 microprocatsorand compare lhem with lhosc of lhe 8080A
a-
Analyzc a mcmory ircrfacing circuil, and specify
lhc mcmory map of a 8rv.n mcmory devicc
Rccognizc lhc pon addr€ss ofa givcn I,/O devic..List additioml siSnals found in such sp.ciallydcsigncd dcliccs as lh. 8155 and ihe 8755/8355,
and analyze lhe inicrfacing circurl oflhe SDK-85
3 THE 8085 MPU1
The lerm }licro Proce.sing Unil ,uPL lr .rmilar 16 lhe tern Cenlrai Plocessing Ln::
r C PL' , used rn rad flrond I .ompule rs fvr rlcfin -thc IIIPU as r d.vicc or r SrouP of dcvicer
(5s i unrll rhar can.ommunrcale *ilh-pcriphcrals. Drovid.liminS signals. dlrtct data floL'ld gcrform computing uskt as spt(rfied bv the inshilrcn\ in memory) fn( .rnrl s.jhalc thc necessary lines ior the add.es! bus, lhe dala bus. and the conlrol tignah. an
would rcquire only a lgllllqll and a cl!g!19! equllalenr freqrienc]'dgrerminm
co!1po!enl, ro bc complerelt funrtron.rl
l ElH.r rurlss bul of rhe 8085 mrtoprot.ssor is multiplar.d (dtESi6-tr d.r. br.. tlibll; seed tl) b. d.rnrltPl.Ed.
2. Api'rofrtu$iHt iiaa Fd t9 bq gct!.t!d io inerfice m€rhory atd. UO vithtOas. (lnt.l has sode. spccialized. rnemol}] and I o dcvices thal do not rcquirq s
coanol siSnals).
-Osing thrs d.scnpdon, lhe 8085 microprocesso! can almost qualify as an MPU b
with rhc fouoerng rwo lim(Juons
'tlis scclion lhows how to demultrpler rhe bui and genemle the contol signals 3:
dascribing the 8085 microprocessor and rllustrales the bus limings
3.l l The 8085 MicroprocessorThc 8OE5 is !n E-brl g.n.ral purPos. microproccssor capabjc of addrtsal$ 6rKmcmor) The dc\rcc ha' lonr prns. rcqurr' a 15 V \,ngle pow.r sirpPly' and cen oFi\rrth a l-MHz srngl..phasc clock. The 8085 ls an enhanced version ol its prcdecessor'
8080A. rrs innluctidn set is upw.r.rd-compatible with lhal of the 8080A. m.aning tha(
81185 rnnrudion rr ,ncludes all the 8080A 1n\tructions plus some sddilioncl on€s
grnns urfi.r for thc 8080A will bc e\ceutcd by rhc 8085. bu! rhe 8085 rnd thc-8
Jrc n,,r n,n (umDrtrble.
- F curc , i.no". tic tng,, p nout Jr lhe h085 nrcroproccsrrr .\,1 ll.! s'Bnal'
b! cl3s\rIed lnto ir\ groups r l, lddrcrs bus. l:, dsla bu,. O) conEol !,d strtua ai
(,1) powlr supplv and frcqu.my !ignalr. (5 I inlcrrupu tnd p.riphcral i0 itialcd li8nlb.(6) s.nrl l/O potts.
E {l Bq ! FY
60 MICROCOMPUTEn SiYSTEMS AND HAADv,rAn!
ADDNESS BUS
Thc 808J has cight signal lin.s, AF,{!, which at! unidirlcrioml and used as th. hig}-ordcr addrcss bus.
MUI.NPLEXTD ADDRESgDATA BUS
Thr siSnd linas ADi to ADo arc bidirE doaal, th€y scrvc a duel purpo3.. Th.y ar! uscd
as th. low-ordcr.ddnss bus as l,cil a3 th. d.tr bus. In r&culint rr'insEuction, dudntItrc a.rliar pan of $G cialc, th.sc lincs arc l]sad i thc low-ordcr add.Br bua. Durini li.lsrlr pln of r. cycl., thcsc lfura .rt ulad a! ria dltr tos. (Thi5 b .l!o t own as
. nuhiplcxing thc bus.) Howev.r, thc low-odcr addtrss bu. can b. scpsJatid ftom thcasiSrrls by llsilg a lilch.
zi- Ll
tz -rl lIItIIIcEIx
muhrplcxcd bus and generate a s.pant s.r of cighr addrEss lincs, A. lo &.l',- - = [D-Rcrd: Thrs rs a Rcad conrrol signal {ac0!c low,. This signai rndicatcs lhat
CONTROL AND STATUS SIGNATS
This group ol qignals includcs rwo conEol srSnals (R-O and wR-). three sho! sipalr(lO/M. 51 aod So) ro idcntify lhe naruc of th. opcratiofl, and one spccial lignal (A!E) to
indicalc $c b.ginning of the opciedon. Thesc si8nlh arc as follows.
tr All-Ad&ir. l-rlch Efliblc: This i3 a positiv. going iuls. gcn.rat.d ev€ry tjmc !h!t085 b€8ins an operarion (machinc cycle); i! indicsr.s thal dl. bits oo AD7-ADo sr:sddrcss bils. This signal is uscd pnmanly !o larch lhe lo\r'order addr.ss from Ur
selectcd I O or memory dcvrcc rs ro be raad and d4a sra ava,labl. on rhc data bu!f YR-wfllc: This is a Write conEol signal (activc low). This signal indicar.s thai
dala fi tha data bus are ro b€ writtan inlo a sclacEd m.olory or rO location.! lO[: Thrs is a status signal used io differcndalc betwc€n L'o and mcmory ope.stionr
*hii'ir,s trigtt. ir indicates an I/O opcradoni whcn i is low, ir lndicai.3; mcmoopcrarron. Thrs signal rs combincd *uh FD (Rcsd) and EF rwntc) !o gcn.rrE UOImmor) control rgnals.
,Q;sr'r!d $t These slatus signah. similar lo lO/M. can identify vsrious opantions.' thay aJr ra&ly used in small syrrcms. (AU thc operadons ard their associ.Ed sra
signah alt listcd in Tablc Ll for r.fcrcncc.)
POWER SUPPLY A}iD CLOCK FREQUENCT'
Thc pow.r supply and frequcn y signah ar€ as follows.
vcc: .5 voh power supply.Vs: Oround Reference.
a
IItldatEFILdqE''i. , at-
3,- "
trld
!lI
afbl90tc dit
This signal ca, b. used as lhe system
\
O8ry8O6OA.BASED MICROCOMPUIER S1STEMS tL./
o
A6l
l lLE J,l6085 Mochinc Cycle Stcrtus ond C(.nbol
X.ctla. Cych SrofilSt lllr
s, ConEol SIrmItOFod. F.r.h
90 R.ld
ID=0ID=oSf,=oTD=OI[=olFlT - o
ID.*f,-ztrdNfI= I
h&tru$ Actno,rhdg.lLlltlold
000.IIIzzz
lqll00ll00lll0 0)x xlx xl
Z . Tr*.r Oran u!.L6)
AND EMERNATLY INITIATED OPEhATIONS
80E5 has fivc intcnupr signals thsl ca. bc uscd to hLmrpt a prcgram cxecutton. Onc$c siSnals, INTR (lnt.nupt Rcqu.st), is idehtical ao thc 8080A micmprocessor inc.-
si8r8l (IND; lhc ofiars a{lrnhrrcemctlls to lhe t060A. Thc microproccasor oc-/ledgcs an i lnu by th. INTA (Illernrpt Acknowlcdg.) sigml. (The intenup(
ID.ddition !o $c int rupts. rhr! pins-RESET. HOLD. and READY-a.crptcxt.rnally inidatcd signals as iryuts. To rcspond to thc HOLD rcqucsr, il has ona signal
HLDA (Hold Acknowlcdse). Thc functions of rhcsc siSnals wcrc prcviously dis-in S€adon 2.13. Tha RESET is again described b.low, and orhcn aIc lisrcd i,l
3,2 for rcfcrcnce.
EBEIIN-: When the signal on $is pin goes loiv, thc prognm countcr is sct to zero,thc buscs arE ri-statcd, and fi. MPU is ns.rRESET OiJT: ThN signsl indicates ihat th. MPU h b.ing r.sct. Thc signd can bc us.d!o rrlat odrr drviccs,
YO PORIit 8Ot5 hrs lwo rignals to implei:i.nt the serisl transmissionr SID (Sarial Input Data) and
(Scrial Ouip,ut Darr). They will b. dit ussed ir Chsptcr 16 on S.rial UO.In this chapter. we will locus on lhe fitst thrcc groups of signals. whila othcn will
discusscd io lder chaptcrs.
'12 Bus Timingsundetstand lhc furcdors of vafious signals of lhe 8085, we mus! cramiic thc timingsthcsc signals i, rtlation !o thc systcm clock. Tha bcst way lo illusEatc $. rilning ia
iu clamPle,
62
-,-J
MICROCOMPOTER SISTEMS AND HARDWARE
. t ttE 3.2
0np1n)trtflta
80&5
. iim (oqur)a nsr ?.S (hFltr)
tsT 6.5RST
',5. T&$ 0rptlo. fiOU) Onpur)
. HLDA (o!rpu)
..READY (lnpul)
6ld Er€andllY Inilldlad
I €m .R.qucsti Tlit is us.d a! a gcner.l'pwP6. inErrupr:.il is timilar
to lh. INT siSnal of rh. E080A
lnr.rdpt Acknowl.dg.: T}is is urtd lo ackno*ledge an i.tcrruPt'
R.slan Inr.RFs: Th.sc ec vectoEd inErrupF and rarsfer dE program
.orrcl io sp.cific dlcmory lo.ations. Th.v have highcr Eiond's thar
fie INTR int€trupl. Among rh.sc 6r€e, the pionlv ordc, is 7'5 6'5.
and 5 5.Tnr rt. nonmatlabl. mreruPl.nd hs lh. hrth€'r Pno rv
Thir sitnal indicaGs thar a F.iPn.El ruch as a DMA (OiEct v.mory
Accesg coniroll.t is rcquestin8 he use of lhe addGss.nd dlla bus's'
Hold Acknovl.dg€r This signal acknowl.d8cs rhe HOLD equ€sr
This si8n.l is usad Io dclay lh. mrcropc.ssor Read or wfl.le cvcl's until
a slow rcspondinS pcipheml is lt.d-'- ro scnd c acc'pt &la Uhcn this
sisnal 8oas IoB. he micrcproc.sor wars for an inr€gnl nuhber of
cl@k cycles un(il il Soes hi8h.
Exdmp16J,I
-:
Soliruon
Rcfer ro rhc cxamplc in lhc last chapter{2.:4): lliustratc f,i€ timing ofdal! flo$ wh'n tht
insrrucrion code d I OO I I I I (4FH-MOV C.A)' storcd in location 2005H' is
being fctchad.
To fetch thc byte (4FH). the MPU needs to identifylhc mcmory location 2005Hand'nable
th. data flovfmm mc or-v. This is cellcd lhe Fctch cycle' The data flow is shown in
Figure 3.2;lhc limings (Figure 3.3) are.rPlaio'd b'low.
:''
O Srrp l: The Fogrsrn countlt Placcs lhc l6bil rncmory ld&Gsr on lhe 'ddrcrs
bus
tFiBl'! 3.2).
Fitu.3.3 shows that at Tr th. high-ordcr rEmory tddEss mH ir-pbcd 'on th'
addrc$ inas Ao o lr. the t6u'od.r mahory .ddrc3t o5H i3 pltccd on t!' ho!'tD' lo
ADo. ard tha ALE sign.l goes high. Simtlarly, lhc stetus srgnil IOM g06 low ffotc'rrng
,rrii r,i. i. ",*r"*Lnll ogc;do$ (Fd drc salc ofcl,iily fi' orh'r two statur litnals
S, and So, arc not ihown in iiSr.rr. 3.3, thcy will bc dilcuss'd in $c i'xr chlFrr)
tr Sllp 2i Thc conrol unl s.nds lh. conlroi 3ignrl ED o cnable !h' frlcliory chip
(FituE !.2).
Th! control 3irnel ED i3 scnt out during th. clock P'riod T: ihus 'nrblilg
ihe
ftmory chip (Fi8ur.- 3.3). Th. ED signrl ir acti!! during two clock P'nods'
c4 MICROCOT'PIIIER sYsTT\IS AND HARDWARE
E6UIE 3,3lela tqnJ.rSffil16r&0
€a Bi.tqD
Ii
h
F
F
ptIt
rl
2. oJ-4
t1,
-bZ ",,t4 41
\t,.,.' ,l .r"41-,59| L
ii cooBEd io F En.Hc (G) pin of rh. lstch, rd dlc OurFrr c.drol (G) sitnal of (h.tLh i 8rcundcd.
FiguE 3.3 !ho*3 dlat olc ALE 8o.s high durirt Tr . Whco dE ALE ir hith, dl. lltcni! csnsp.rcoti this I'Eans &rl lha oilt$a chartpt r.coGling !o iBput d.u. Dqdnt 1t. rha
of tlt! l.ich b oJH. Wtcn 6a,t r.coNrn8 lo mpul d.r!. l.lulnt r t. rha
i .L?*, &. dd. blt 0r{ ii h*d uorrl
lmii his circurnventcd !h. Plobl.m of dcmrrliiplcxirg th. low:ordcibui iy d€,
^i$in8 sp..ial dcviccs such as thc 8155 (256 bytcs of PJw mcfior, + UOs) and t35J
(2K ROM + vos), which arE compadblc wiih fie E0E5 ftultiplcf,cd bur. Thcsc d.vi.r!imcmally dlmulriplex &e bus usrng thc ALE signd (s.. Figurc 3.14.0d 3.15).
3.14 Genarating Contlol Signqls
urqu of tlrl l.ch ii 05H. \Yhcn *a A{fflar lrry, dE dd. bI! (EH ir Lt ld u0rrt
0!{il-ALE. .nd u. ouDtr C fr. llery-iff*t5r.. b. A{-& fqrhFgLgi Fitur.3.4 3how3 rhc.nrirc iddrEss bus A,;-,Ao ltcr dF latchins oD.raion
Figurc 3.3 shows thc FD (Rcad) as a cootrol sigttal. Si6c! lhi! sitnal is usld Mr fcreadinS mlmory uld for rcadio8 ar input &vicc. it is ncc.ssary to 8cneratc two diffcrtR.ad siSoals: onc for mcmory and anothcr for inpur. Similarly. lwo slparaL Writc signlhmust br gcncrarad.
F@! 35 shorr! thal Jour diftcrcnl control sjgnals ut gcnerated by combiningsign.k RD, wR. and lO/M. Thc signrl Io/U go.s low for dlc rEmory oFrition. 1
'\
808'60!OA.BASED MICROCOMPLIEN SYSIEMS J'-
,r. (il!(
),
I
o
,t6ull s.aitaEqgucdLdhllslL ordalrddlsBu3
/'arral is AND.d wirh itD aM WR signals by uiing d( 74u12 quadruplc (wGinput OR
t r.". a snot n rn Figur 3 5. Thc OR Irtes are fuicionally conleLted as n.galiveN,rXD garcs (s.€ App.ndrx C, Prtfcrtld lrgrc Symbols) Wh.n borh rnpur $gBrls 8jLr*. $ebuputs of th. gatct go Iow and gcnerat. EIEMF (Mcmory R<.rd, and \tlrtw-
i
bftmory write) cooEol signals whcfl rhc lO/M siSnel gocs high, ir indicales the F.iph-bl ,O opcrEtior. FiBUE 3.5 shows thar this sipal is compl.m.ntcd using the Hcr
741-"sO4 and AND.d wirh dr ED and WF si8n ls ro g.rr.oE 6R 0,O R.ad) mi(IO w.irc) contol sign ls. Th.s.'cqotrol 3ignals all unnecBsary for lntel's 8155
(bviccs t!.c.usc th.sc si$als arE g.ncratcd int€mally using [D. EE. and
d.multipbx lhc bos rnd ro gcncn& th. n.c.ss{ry conEol si8flals, th€ 8085GquirEs i latch aDd logic garcs tb build thc MPIJ , as shown in Figure L 6.
MPIJ can be int rfa.ed wilh ary mcmory or UO.) l
3085
-
ii 66 MICIOCOMPUTIR SYSTEMS AND HrA NDWARE
n6ma3.ls.hcrndilc lo GaDaEtoi.qdi/v'rrn Caotrolsfgnqblcr Marrory ond YO
3.15 A D€tdlled Look qt the 8085 MPU (Ind Its ArchitectureFiglllr 3.7 $ow3 thc intlmal afohitlcture of rllc ?oE5 b.yond lhe Fograrnmable rrgist'rs
w. dilcuss.d prcviously. lr includcs rhe ALU (Ari$rnctic ahd t gic Unit), Tihing atd
Cotlaol-Unit, lnstsuclion Regist.r and Dccoder, Rcgistcr Afiay, IntenuPt control,..and
Scrial l,b Conrol. Wc will dis.uss the firsi four units bclow, while ihc lnst two win b'discuslcd l.tcr in the book.
n6t,lE 3-68085 Domullpl€bdAaldrs drd Ddto Busvtlh Conlol Slgrnql,
!
fr*
EMR
t--a.2
2..8035
lo,M
trD
WR
.Nr..^1Lr.t.aJ, 0 / MICnOCOMPUiEn SYSTEMS AND HAI?DWAiE
ft€ ALU
Ihc uithndc loSic unir Dcrfo*. 'h. coEB{in! functioo.i it ircludes t!g-!!q@Uor.rhe r.mmt"fl Ecirr.r ih. rirhmc0c and logic circuils. and firc fl!8s. Tl,. tclIllgy,.g--irroi[ u-..iro--lrori a.,"- m;;iifrifi;aT.g;c opciiiiiiifrc rcsutt iii-tonoin ihc accumulrior, and lhq fls86 (flipfloF) ate s.f or Escl rccording lo thc rcsuh ofth. oparation.
Thc flags ar afrarrai by dtc Erithm.ric and Iogic opcrations in th. ALIJ. In most
of lhcta op.rations, thc rEsolt is slorcd in lha lc.unulalor Thercfore, lbe flags genetally
rrllacl dats cooditions in lh. a.cumulrtor-gith sonrc cxcc ions. The dcscripiioos and. condiiions of rhc fl.8s uE as follow$
o i-&fts t .!6car!edo. of aritctt d lo,i. Aqdidt, if bit D?or thc
rcriorr rdrrdi'rn ui*iuriutr*).ir'1, ir3Ig tlryir pc-t. @.ggtr xoa uttrt{ir.dl|5inbtfjbadv!.byE-f D' 8;1,;l!brai, ii 13 o. tu-.!i!bi; iilr b. od;wih {Fd ri{rlt r!, bitD it ttsavld fd indk{int {ic.ip' .d dt. rqr|.itlillg
!t dl E b dE odH t tir.t5.tr Ac-Ariaiit cjrt fLa: ln rsrrhcu. oFntioi, eh.n ! c.n, i. totctrEd 5y
diSil D! afit p.lsci on to ditit D., lhr AC flrt i. r.l. Tlt fl.t ir usc{ {l y
intcm.iy foi 8CD (8iwy Codcd D..iEdl oFr.riQrr|, iin4 i{ iol rvailrbL for th.prqranmcr o cneagi lhc lcqlcrcc of , Prog"m widr r iump hatriction
C P-hrllr. fltg: Aicr rn rrftiftliq or hlictl og.rdi@, i{ 6c rriull.has @ cven
niitnbd of i., dt. fl.g i. ,.t. lf lt b.r.+cd4rotcc *Jr-$FJr&!rt!r.1. (For
cr.rnd., thc drl tty! 0 0 0 0 0 0 I t hrt c14! prdty cvan il dr nlrgniiudc ofdt ntrrihcr is od).
: Cy -Crrry neg, If at| irirhmclic opcr.rio tesulls in e crrry, tlE Calry fl.g is rat'
ottrcr*lsc it ii rcsa. rrrc C{ry fl.g ako scrvcs .! a honow fl;8 for subtrrctiotl.
The bit positions rcservcd for lhes€ flags in th€ flag registcr ar€ at follows:
Dl DI
LtAmong thc five flags. thc AC flag is us€d incmally for BCD anthm'tici the
instruction Jt docs not inalude any conditional junP insEuctioos based on the AC flag
of $c rEmrioing four flags, thc z a d CY fhgs are tbose mosl commonly used'
TIMINd AND CONTROL UNiT
Thrs uni! syirchroniz€sall the microFoccssor oPcrations *ilh th€ clo'k, 'nd
8c[€rat's lh'cortrol signals nccessary fot comm;nicaiion bctwc.d thc nuc1oproccssor
'nd pcnph'rals'
D.qDrlDIDtD
s z AC P ,CY
80atr
Thc (alqINSI
3 16
D.co
6 iir
t-I1t
TtIG&Lios!{
lge. NEE
Thc IrfrEr
Tha
Ffa
tI
IIG::-!
E08ts080A-&\s!D MlctocoMPlrr;R s'vsTEMs
Thc conrol signah .rc simriar lo r ryr. pols€ rn r,l o.cilhc('F. Ita ID id TT d,ndar! ryic Frlscs indi.aliry fta availebilily of &lr oo Ul. dau bo!.
INSTRUCTIO}{ 1EGISTER AND DECODER
It llrslucrioD r8rst . and thc (hcodcr aI! pln of thc ALU. whaa .|! inrSlation irEEh.d lrom m.mory, ir rs loadrd in ttc insalctbll rcdlEr Thc (Mcr da.od6 dri$truction .nd est3blisrcs ihc *qucD.c of cv.nls rc follox,. Ei
rnd iaruoa ba aaicsscd
lER ARRAY
pmgrammable rEgisters havc b..n discuss€d io lhc lr$ chsplrr. Tto dtlhnal
09
:tJ
t'.rs..ad.d anporlry rlfi$lre W {d Z, tr. iiclircd in 6c Efir&r Err. lto.s.rs ani
'rvd ro hbld 8.btu &ii duriog dia .refuiiri bl liriE iarrakri frtttr,
rb€, r,! us.d i0lEnlally, rhqy rrc riot evrilrblc io thc-pogrx{u.
.i6 Decoding ond Executing on InstructtonDccodmg and cxecunng ar in.lruction !ii.r it has t cn fcahcd can bc illusllrGd *ith ih.rlample from S.ction 3.1:.
4ssume ftlt the ascufiulator contairu dat! bytc t2H. and thc inltnrction MOV C. A {4Ftl)is liiched l.isr rhc ste?s in &.oding srd erccuting lh. insulclion.
This cxampl. 1i limilar to rhc eiampb in Secrion 1.12, cxcept thar lha coflGnls ol rhcac(urnuldtor arc specificd. To dccodc and cxcc\lta &c inrnucdon. ih. followin8 st.D. artpcrforma.l
l. Th! Jonreirs or de dna bds,lFr al! placeJ I,l tha rnsrrucrion rcgrsrcr and dccod.diFigure.].8).
FIGT'DE 3 8k.slirdi9n Deccdlng qnd Execuuon
E qmFl6l2
Solriion
{lF DrD lu. + FDo VcF^
70
-a
MICROCOMP(nE& SISIIMS AND HARDWARE
,. Tha con0art! of dl. eunuhtG (t2H) alt Eanlfanld ro rtra ElDcrry rl8ili.i in lli.ALU-
3. Thc cootsotr of dr Emlorrry Egistcr rrE tautifgrEd !o irgisEr C,
3,2
3.17 Rer&r d.frrtporicErt Conoepl5
l. Thc 8065 microprq:rtrd h&t r mulripl€x.d but ADr-Aq usad .3 thr low-ordcrlddllss bus .rd dr datr bu!.
2. Th. bo! AD-Aq cr,| b. d.Euliiplcxcd by u5in8 . h.h .rld lhc ALE signd.3. Th. 60t5 hrs r srr$s .irn.l IO/M |rd r'ro conrol sigds m.rd m. By ANDitr8
tc= sgnds. r;ftffi;E cra tr;; .ffilffiffi:, rtr'.,'d lfitt:( Th 865 MPU
D tr r3fcrs dala ftom a mcmory tocstio[ to the microproccssor by ucing lhacontsol signsl McflEry Rcd ([iEFiR-Acrivr Low). This is .ko crllcd Ir dlqliocffiy.
O trrlllfars &rr @-.1@ nicroproc4u io r&rndy by usint lhc contol lignrlMcmory Wriic (MEMw-Activc lrw)- Thi3 is also callcd rtltb8 ho barnory.
o rcrcF5 d.lr from iDFrt davic.s by uliDg rtlr conEol ligD.l Uo Rcrd (mn- ActivcLrw). Thi. i. d,o tnow! .! rldra t o .! B po.i.
tr t lr drrr to oueur dcvicd by utut th. conEol sitd lio wti@ (f6w-Activ.L.*). Thi is rllo Inown I rrttht to .! oohof fo.t,
l. To .&.uE .n ir&llcdor, 0l! MPU
O phcar hG lrl6n&ry addtat of dlr inatsuction o,t 6a ddrlta bur.tr irdqt r da oEniion urut on tlE luoa lill.r.f *ndr thc FEffi contol ri8Dd !o ana6lc $c rrtnory, fccha! thc inmrcdon byta,
t d phaar il in lh. iorfuction dccodlr.O cx.a{t s thr idErrtior.
EXAMPLE OF AN 8O8s.BASED MICROCOMPUTER
A gaDcral rnicr@dtFe, rystlm wr. illustrsr.d in Figur! 2.9, ir! tic lafi cbrF.r. A.frcr6ur dis.ussion of $. EO85 miqbFocaslor utd !h. intlrfacing &vicc., vc c.n c&uLQ|syst m io hclud. morE &tsil., .r rllovo ro Figurl 3.9. Thc sys&E Eclud.s intltf..itrtidrvic.s such ai El@rda€ld.rs. and hrch.t This sysr.m ir dis.usr.d bclow in dEE
sccrions: fic 80t5 MPU. mcnrcry. .nd I/Os.
3,21 The 8085 MP(,Thc t0B5 MPU modulc (Figltl 3.9) includca d.vicca s1lch ,s lhc 80E5 ,ricrDFlc.5sor,.Il ocEl latch, ind logic gat s as sho*n pr.viously in Figurc 3.5. Thc octal lrtchd.muhiplcx.s dlc bus ADTADT u{ing thc rigral ALE, ,rd th! logic gaE! g€rsalr dtc
\"e
116018 t.9ao6li SIlElcfoqd Mcroco(lDul'.rs}'lhnlOtE lL t| ^!r^t| |. i-ldrE a di.'..l5- E . d xo.d i- - td.La tt.qr 1.6 ir klrl i I l4il
MraaocoMPrJIERrYsTEM! AND HAr:
ncccslar-J conEol sitnals, Fiai,r 1.9 !ha*$ th. drmulliplorcd .ddEss bu!. rhc dt!.d thc fow ..riv. iow co.rol rignrfr: lvt-EEi(, ME!tr, Ifi'. ua IO-f. toincrEas. dl. dnlins clr.Crw ot drc bJsa. r un:di.criorEl 5us dti!.r 15 used
addEs! bus urd . bidilErtror.l bui drir€r is tl3cd for thc dall bus.
3.22 'lrlornory 'del i;' l4;'- A r i !< \
fhc Eo65 Di.'.ocofirputcr shown in Figurc 3.q has two tvlEs of m.[lory chrpa-R(Rcrd/Wtir. Nlemoryi and EPROiv! lEr.srbk Proglrnlmlblc Rc.d"Ost, M.mo.,ei& ll!ryE! Thc nemory s..lion oa F,gu& 3.9 is.xpedcd in FiturE 3.10 !o
fe* llDrc &trils. The am oi lhis ,liscusrioE is to idcorily 6d rd.mor.v m.p by ma]lihr arsoaiat d crcuits, .od !o Gc(,8riz. rk fuqclions of r*"o control ri8n,ls: MEMRFiEFffi. To rimplify th. prcrlniadon, dclails coiceming th. rn mory chips anjtrFmory nmirg uE cxcludcd haE. llltcl's 3pccial-pllfpo5c memoty chiPs-|fi. 8lsiUE t755--and &cir rr,qDory rn ps ir thc sDK-85 lysEm .re dcscribcd it s.ctioo -1
BTY ME}IORY
Figlr. 3.lo strows tlltt rhc crSht addit$ lin s Ar-Ao $E ronmct.d dlrcclly ro ihcliner on lhc n|cn$ry chip !o idcllify:56 EEmor, localions. The rddt ss iilles A,, !o.I! u!.d to sclcct thc merrcry chip lhroogh a !-lo-8 dc.oder snd lo8rc 8n s.
. ldandfyroS thc mcmora m.p l' a t*c-staD procals. Ihc first stcp ,s tc rccoeni4logic lcrals rwuiEd on tb. rddrrls lincq l;{. to !.l.ct th.'mcr-ory ahip. Th. r..sr.p is to ardnior drc poasiblc logic lelel combinationc !ha! can be.ssunad by lhc
whcn 6r R/WM n nrory chip is s!l.cLd, thc lotic lcv.ls or lh. iddtE$s li!6Arr-& shuld bc .s folloys:
Thc .dah6s lirc AE is collncctad to thc acliv. hiSh lnable linc of ih. &c!d!r duirrg &invcriac lhclrfort, ir should bc .! logic 0. Thc rddrcss lincs Ar-Arr shoujd slso bc al loSr0 !o .crivlt thc odFr (wo.nrblc lincs racu!.lo*) of dl! decodar. Tt. !al$ C' ad G.
rE OR garcs, fuDctiorEll! conEcct d as o.gativc NAND 8.lcs Is.. AFpandrr C
Prcf?nd L,ogic Symbols) wheo lh. inpu addtess lioes Am-Ar to lhe decoder a$urr th.logic levcls I I l. tlc alput liDe ? of lhr dccodar goes low and salaats 6. R4;drcrbry chip,
Thi ileoory chip has eight addre$s Iinls thst crn asunIc 2ni dffctltt coftbiortionsfron 00H io FFH. T"ncrcfore. lhc m.moq! map of lhis chrp raog.s froft 0701t to (nPFF'
A,. A. AD A,: AII Aro A' AI0 o 0 0 0 I I I =0?H
A, A6 AI A" A' A: AI A{00000000iillllllllll
AJ Atr AU.Ar: AIr AI A* AI0 0'0 0 0 I r r
07Hehip Scbt AddrEss
= 0700ll
= U?FFH
73p6€/6O6OA-BA5ED IllCnocoMPUTlR S',YSTEMS
' r/"V
-M-.Mi
D]r.tl
o,
i
1.10MemorY:nierlocing
74 MICROCOMPI'IIR S TEMS AND HARDWA&E
EGUIE 3.llTlldm ol tha tiLtnqt YVrrll Cfcle
Tt TJ
LJ U LJI v..-y eaa*.
I ^_A.
I o- ri
lt_-__r
CLK
IO' M
EINOM
Uta thc R ly mcmory chip. ihc EPROM also has 256 bytes of fiemory and ftquit s ciShl
.dd.css linc., A-,{o, to id.ntify 256 lo.ations. Hoqevcr. its m€mory map rrngcs ftom@H to @FFH. a showD D.low
= qmHAg AI A" AI AI Ar ,\0000000
It
0
tI
0AN AI' Al1 A" ArO fu000000,0
\NTChip Sclcct AddEss I I I I I I I =(nFFH
ln tii ltEmory citluit, lhc only diffcr'rr' frcm fic &w mcmory circuil B ih't tlt CfiP
i;t il; il.il ;*" rlrc input to thc &codcr \s 0 0 0 Thus' thc hiEh-ordci I
*tnYlHl$"**n *"-. ''" ."* .iTiim#_Hffim
inforlruibn ctn mr bG wti(an iolo t ln€ !- rimilrr !o that of FigutE 3 ' 3 ' crccfl rhat I' Eufi
&d*iplcxcd butcs'
MICROCOMn TEn SYSTIMS AND HAI!,WARE
r.*--{\_=^.--1J l
e, !!9. t58
d
I!
aEn
rltt1II
lIiITtid.t
r
lI
i
.1B
;:lt;
.1ttr
ddri
flei,Il !.llInbrtrdnC LtO PoiE
\/S.Za tne SDK-E5 Memon
!l!c6!
re!rhtr !,1dl
GllThc SDK-t5 is s siltL-boud mictocomPurr dcsigocd by lnlal an4 wi&ly utld.in collcgc
l.bo$toiica. Tbe sy;taE is dasigned uriry th. 8oE5 microproccssor ard sp€cially com_
D.tibl. &vicc5. such ar the El55,tl56 and the t355/8755'' Th. 8155;8156 and $c 8355/8755 hcludr mulliPlc dcvic€s or the taff chii' Th'
8155 hes 256 bytes'of Rw m.mor,. two Prograrnmabh I'O Pons and a !mer' Thc El5t
is idenlical tp tire E 155. exccpl rhai its Chip Enablc rcn signal rr acrrvc high' Thc 835!
is a ROM *i& rwo progrnmmablc Li O Po ' and thc 8755 is an EPROM '
pin conpatiblc
.,irf, ,ft" e35' ft "
i.;/".mable ,o pons ol thes€ devices $a dis'uss'd ir chaptcr I 4
IIg*34.
-tq
TIic mcmorl scc on of-thesc chips and ilreir memory maps in the SDi('85 sy$em wiu no
bG disccus.d,
TI{E 8]55 MEMORY SEC'IION
FreuE 3.14 rhows thc block diac;m ol the 8155 memor) s€'tlon' h has cighl addtst
lin; .nd srr lin a compatiblc wrth lhc control and status signalr of thc 8C85: CE rchrt
EllabL), lo/ii, ALE,IiD. WE, and RESET lhese control and slatus lines 3rc oot foun'
in dlc gencral-pupose memory deviccs shown in the prcvious s'ction' These lincs elim!
80896080A-&{SED MICnOCOMP'JT:R Sys',iE}r3 ,.,7
ro9
?t-.ALE
ED
ET
fiTiEtraiT- -flNrER C' K--l
lLtE
TEBl5.835lli!La ll
HGUTE 3. 14
The 8155 MehorySecljon Th6 Blo€k Dtogra6.: i.-)SOUICE, A, Iitl CoEod's, ,vCJ - $tqt fektlr a k t lq^roi \S@
lslc thc n.cd for cxl.m.l dcmoltiplexi;g rhc bus ,
coDml siSnai, fo. m.mory and i,O.
.8r!!!r!!... -f8.3 J6rl:6.: . CE
Figure 3.1.1 ako shows ih. intamal rt!!c!ur. oi lhc El55 mcmory *ation. Thamcmor) s€ction includc! :S6 y 8 mcmot locrt,ons and an int.mat jatch to d.mutriDl€xlhc bus hnes AD.-,\D, TI. mcmory rccfion Jilo tcqurcs a Chip Enablc r-E, si8nal anda Mcmor) Wnrc
' f,iEFiI-r. cont ol s,gnat.
-ge n.rarcd inrcmaltv by combininS rhi IO,V
.nd WR signals
Figurc 3 15 rhows a schcmatic o[ tiie SDK-t5 gyrt?m of incrfscing thc 55rncmory scction with rhc 80t5. The 8205, a 3.to-8 d.codcr, dccodcs th. addrcss lincs
nculr 3.15IntErlqclng rh€ 8i65 M€ho.yS4\6rnolic fom lh€SDX.85 SFtemSOUtCl ltrkr Cmi'd- lDf -rJ Ls',r.tur rtrN Ch;, Crtir
^urh t9r3r. A,,
A|'.rlir B A : IO, EALE
E5w-i
RESETdrlachFioud
[;ll'1_l
l^i
l"lL-lr-l
I-r,s-i i--,
+sr
,E,E:8,fE
3t5t
1E IVIICROCOMPITIER SISTEMS AND ThRDWARE
Arr-Afl and thc ourput ljne 4 o[ (hc d.coder €oabl€s d. mcmory chip. Thc conqll rtrdthe status signals from thc EO8J are connected dirccdy lo the resP€.tivc si$ds on thc
memory chip. Sinilarly, lhe bua lines ADr-A..rE aiso cotrn€ctcd di&cdy !o thc memory
chip to addrcss ary ooc of thc 256 mcmory locatioas.
Ercnple kplaio the de.oding lo8ic and the memory map of thc 8155 shown in Fi8urc 3.15.
Thc intrrfociDg togic shorrs tbe 3-to-8 de.od€tl its output Iirc 4 (O.) is us.d to *lcct lh.8155. Th. addres6litres Ar to AD rtc contr..tcd as inpul to th. alccodcr, and lhe lmcs Arjsrd Ar arc uscd as activa loi Enablc lines. Th. third Eaablc lirc (a.tivc high) is
p.nnarcnd, coabl.d by tyinS it to +5V. TtErclorc, outPut lirc 4 of tllc dccod.r gocs low
whco drc ad&er6 Iin s h c thc follo*ing addttssi
X = 20H (Assuming t'c donl carc Iincs aft at
loSrc 0)
Thus. th. Ermory mrp of$c 8155 tncnrory *ill raryc frcm 2000H to 20FFH. ln r.dity'tlt nE Dory s..tioo of this tl55 uses th€ mcmoty sps.c liom 20@H 0o 27FFH. Th€
SD(-85 m.ud rlfcIs ro ihc m.mory lpace from 2ImH to 27FFH as "foldbact sPac."'which .ErDs it i3 ool bcitrg uscd, but tlci$er is it avarlsblc for !!ly .4alrsioo bccalle ofmultipL addrBscs (as axpl.incd bclow).
ln FitorE 3. 15, lhc ad&css lincs Am, A., ird Ar arE doal cal! :trd crn .ssutr. logic
strEs 0 or l. lJ lhcsc lhrlc lincs assurE logic I stltc, lhc trl.glory nrap will r.n8c ftom2?OOH to 2?fFH. Alt.rnpting to slotc a progrtm in locrtions on p.8c 27H is lhc.sah. as
entcrinS tbc lroSram in locations on Pagc 2OH The tnelhory eddtlss.s ftom 2lmH to
2?mH will aactss th. m.mory rcgi$e6 from 2000H !o 20FFH. Thcr.for.' dte EE ory
sp6ce fiortr 2lmH o 2?FFH, cdlcd foldb.ck Imjmry' caoool b. us.d.
Solution
A|' AU AB Al1 AlI Alo A;00t0oxx
\'r IHE 8755 MEMORY SECTIONN fgur. L Io .to*. rl,. inErfa.rng of $c 8?55 EPRoM from the sDK-t5 svstcm. Th.
cirEuit us.,. thc lamc decodcr, 8205, as lhe 8155 interfacinS GiSur 3.15). Th. 8755 hrs
2O4E hyE! of lrEmory aad nquires 1l ad&css lincs from thc micloPro.t$ol. Thc r'st ofth. addr€ls lirEs are uscd !o selact lhe chiP. Thc outPut liIE 0 of lhc d...dcr salc.ts lhe
chip. Theraforc, iltc mcrlory map ranges ftogl 00q)H !o OFFH' &s showo balow.
0
iI
0
II
0
II
Al, AB A1, AD AIIoo0o0
OQH
0000illrIIIl
F
0 0 0 0 =0m0HtltlltliI I I I =07FFH
F
oo0001ll\------l--J \-/-J
TIG
IDt(
Sc$
sYrsol,
32
HddTD'Es{br{L.l
8085/8060A-AASEO MTCROCOMPU1En SYSTEMS
Frcutl 3.16Inlorioclng th€ 8755 Memory-SchoEtduc fom SDK-85 A,'
Systom atr
SO0iCE lrr.l c.qEnid, SDi-t Ur.itLrn&? (Sub Oe. C.lil,: Auo.r, 1973),
roM
ED
3,25 How Does on 8085-Bqsed Stnole-Boqrd /Microcomputer Work?
Hardwar€ is the rkcleton of fie comput€r: 'ofr*are is irr life.'The soirware rprogams,makes th€ coftputer livc: withou! it, lhe hardlr?re is a dead piece of semiconductoa
matenal. Singl.-board microcompuErs, such as the one sho*n in Figure 1.9 or the
SDK-85, have a p.ogian called 'Rey Monitor" or "Key Exe.utive" p€rman€ntly storedin memory. Thi! program is stored €ither in EPROM or in ROM beginning at the memorylocation 0000H.
wll.n the power is nimed on, the monilor program comes alive. lnitially. the
Plogam counter has a random addftss, rivhed the system is reset, the program count€r inrhc 80E5 is clcarcd, and it holds tftc add.ess 0000H. Th€ SDK-85 system includes a "poweroo" rcrct circuii, which rescts the system and cl€an thc progrdm counter whetl the systemis tumed on. Thc MPU plac€s the addrcss 00mH on the address bus. The insauctioD codestorcd in locatidn 0000H is fetch.d and executed, snd the execution continues accordingto the instruciions in th€ moditor proglasl. Th€ primary funclions of the moniror program
&! as follows:
l. Reading the Hcx keyboard and cleckin8 for a key closurc. Continuing to check thekeyboard urtil a key is prcssed.
2. Displaying the Hex equi\alcrl o[ the key prsssed at tha outpLr( pon. (uch as thescven-seghenr LEDS.
3. Idctrlifying lhe kcy prEss.d and storiog its binaiy equivalent in memory, if ncc€ssary.{. Tr,Ilsfcnin8 lhc Fogram exe.ution sequcncc to the uscr program when &e Euci.re key.
is praa3ad.
TIlc progi.mlner ent€rs a p.o8ram in RJW mcmory in sequential memory locarionsby Ning ft. dara keys (0 to D and the fuoction kcy calleA Srorc or Next. Whctl th. syst mb r€set, th. progariq counlcr is cl*rEd, aAd the mooilor prog.arD begins b check a keyclosuE a8ain. By usitrg thc k yboard. lh. Fogralnmer ertcrs the first mcmory address
79
i
i
8755
I, QE:
3:05
80 MrcRocoMlrEp s'rsrEMs AND BAnDvarE
wh.rr the uscr prcgram is stored in RyW mcmory irld dir.cts tha MPU !o cxccul! th.progtaJn by prBsing lhc Errcxr? or Go kcy. Th€ MPU f?tchcs, d.c!d!s, and cxccutd ooa
instruction codc al i tilne and continu€s to do so uolil it fachrs ua llar, inttruclion,Thc key monitor progr.ln k e 6itica.l clamcnt in entfiing, rlorint, and cxacutint .
proglm. Until ih. Et.cr.r, kcy is pushcd, lhe monilor pro8tun in 6. EPROM (c ROM)diiEcts .ll-ihc op"rnioB of thc MPU. Aft.r thc ErrcrL key is purhcd, tha usa! F,lltnmdirEcts dr MPU !o pcrform thc firnctions writtcn in lhe progtam.
33 THE 8O8OA MPU
Tha 8080A micrcproc.ssq is thc prcdeccssor of $. t0t5 and lhc dcscqpdarl of lh. fllll8-bi! proccssor, lh. tm8. The insEuclion s.t of the 8080A .rd thc 8085 l! pracricdly thc
sam.. Programs wrilen for 8080A systcms can bc cxrcuEd in E0E5 systchs wilhoutmodifications. Thc p.imaly improvcm€ol of thc t0t5 is io thc alra of h8tdwat! Tha
8080A is not in itsclf a complrtc irncdonal unil as a proccstor; i! rlquirls lwo addiriordchipsr thc 8224 clock gcncrator driver, aad Oa 8228 aysiam conltollcr a.d bus &ivcr. Th€
8080A docs not havc all thc nccessaly condol signals (such as Mamory Rcadwii. atrd
I./O Read^rrit ): $ese signals arc gcncrarcd by using lhc t228 systcm conEoUrr.
Fi8urc 3.1? shows lhc complcl,a, lhrr.-chiP, functioflal Micro Proesaiq Unil(MPU). Tha fuDctional dctails of lhcse chip! at! describcd b.low
3,31 The 8080A MicroplocessorManufac$rcd on a ringla LSI chip using an r{hanncl silic-on'8aE MOS proc.ss, lhis
hicroproccssor is houscd iD a 4o-pin DIP (dual'in'linc P.cka8!). Thc 8080A i! rn im'provrd vcftion of lntrl s ft's! 8-bi! micrcFlc.ssor, lha t008 Figur.3.18 rhows tha pin
'conaactions goupcd in funclional ut ts (s!c Fi8urc 3.1 for Pin .onfituratioa)Tha 8080A ha! sixta€n addrcss lincs and eight data lin.s, and rcquir$ thrlc powcr
iugplics (+5 V, -5 V and rl2 v) atrd a clock with l*o pha!.3 (6 tltd 6). lt h$ Etl
,co;EDl signrls not includinS such contol signals as Madory Rcad/Writa and UO
Rcad/writc discus&d baforc. Thcs. arc gcncratcd usinS tha syst m conEollar. Fo! thc sal.of cladty, thc functionel dclails of cach conEol signa.l a& dmittld h.rc.
THE 8224 CLOCX GENERATOR DRT\ER (FIGURE 3,17)
This rs a clo.k Scncmaor chip dcsiSncd to plovt.l. a t*o.Phlsc clo.k d rnd 4' to thc
8O8OA. Th. crysisl dcillator providcs ihc ba3ic ftlqucncy divid.d by rE inridr6!chip,and ixo phascs-d rnd A-aft gcncrat d for th. 8080A. In .dditioo. da 8224 Scmr'ar.s rhe RESET and READY sigda for lhc 8O8OA, and lhc STSfE (Starus Stsobe siSral)
for the syst In coduollet thc E228.'
rlI:
4u)at60tt8060A-gAsED Mlcnocot"rpursit SysrEvs
OND
l5
TANK
osc
RDYIN
R-E]IN-
+t2v
OND
+DB
+ DB,
+ 03:
NiAMEvE
BEiiFli6Fi6F
PIGUIE 3- I?
E-106!A MPy Ttl€ 8o8oA Mrcroprocessor .hed224 Ctoc( c€neroror qnd rh€ 8228
hEI cd!.n.on. ,t c.r- ar,sJ Fo,r, o"-,, ,--i,r_o c,*. cro : auGor. t9?9). p 6 7 t
INTE
w-n
DAIN
cNn -..:.;SfiTIS.-F6BE I
3:tJ
3:t8,3113
MICROCOMPUTER SYSTIMS AND HARDWARE
TIGUXE 3, i8Th6 6080A Miaroptocsssor
INT
HOLD
READY
RESET
SYNC
INTEWAIT
TI{E 8228 SYSiEM CONTNOLLER AND BUS DRNGR (FIGURE 3I7)This siflgla.chip integaalcd circui! is employed for lwo purpos.s: ( l) as a bidircctional bus
drivcr foa tha dala bus. ro providc .ddiriolal currcnt capabilray to drive pcripbcrtls; and(2) as a con[oilar. to Sencralc rhc neccssary con!rcI signals.
Tha eitht data lines of rhc t080A are conneclcd to thc chiElg gancrata a buffc&ddata bus. Thrc. signals flom $c t0t0A-DBIN (DaB Bus In). wR (Writ€), and HLDA(Hold Achowlcdgc) and ST$[B- lsarus Strobc Signrl) &oIn thc clock a'r uscd s6 inpu!to gcn.rar. flve c;nrol signalsr Mcmory Read (FiEMfr). Memory wril. (FlEFiW), LO
Read (fdR,. ,o wnlc rIO!t-). and Inrcrrupt Ackno\ l.agc rFiiAt. F91furun di1cussioni rll th.Er chi'ps witl b. vi.wed as the MPU. Thc control signals ?6F and 76Farc functiooally simiis, io rhe 8085 control signals mF and low-. rcspcedvelyi lhey just
have diffcrent names in the 8080A and 8085 manuals.
l|CUMnc er,dsourq i,. ta ;
j.1
It'ntdEl6. 80{clrsnflquidrcoorol iinilnat
3.32 The 8080A Bus TimingsFigurg 3.19shows rhc timing of thc 8080A Memory Read cycle. ltis in many ways similarto thc Memory Read cycle of the 8085: however. therc arE some differ.nces.
Tha 8080A data bus is used for the sratls idsniification of an operadon atrd forEansfer Thc MPU places the stanls of tbe operation on fie data bus during lhc eadier p.1of the cycle, and places dara on the bus during the laier pan of the cycle. while rhc 808( Iuses ao 8-bit stalus formar lo idcntify vanous MPU opcradons. the 8085 uscs lhr:.separale lin.s (IO/ii, S,, and Sd ro id;ntifly ar op€rarion. FunherTrore, all rhe neces$L1
control signals can be gen.rar.d in arl 8085 syslem by using th€ status linc IO/M and t{ocontrol sig:Eh-
rbclr.tit
+5V,tV+11VCND
Ia
aIIo
3rt
E
,y80ryE080A-&\StD MICROCOMPUTER S{STIMS
Q-D.
I
DAIII
tcutE 3.19lho 8060A 8u! nmhoB lor tho Instrucuon FelchIOWCII Adrnd ltlB lm.l CoiFr h. , 3N kdo pto SrlrN U r r lrtul (36lr Cl6, Cr!l,: Authd, l97r),, 2-,
Tha MPU conEol signals in thc 8080A aIE 8c[cratad in lhc fashion sinild to that
tha 80t5, by combininS th. microF[cr$ot conEol sigals and lhe sBtus. Howcvct, tl80toA, orc staNs k idcnrilicd usitrg ciSht dal. Iincs, and thc MPU opcrations aIr
cl&sified in tln diff.rcnt catcgori.s. fhaEforE, lhc aystcm conEollcr (lh. 8228) is rc-qrirEd @ htch ttlc staos ard g€ncrat! thc trc....iy contol si8[sts (Figur-r 3.17). Thcr.cotrEol signsls can bc gencrated by usmg thc drscrllr loSic !o poi out th. conc.poaldmilarity bctwen thc 8085 and &e 8080A.
SUMMARY
ch.Plc' ddcribcd thc arhitlc0rr! of rh. 8085 micoproccssor ard illlr3earcd thci.rr ddmultiplcxing lhc bus AD-ADo and gencr.ting the conEol sig,tals.
I:
!IAIIJ 3,3compolnon ol th. 8085 qDd lhe 8o8oA
MICROCOMPTITER SYSIEMS AND
totscmalx.
Po*cr SupplixFuodio.t l MPU
Thr! :+5 v, _5 V. +l2 vThI! chiF:80804, E22a
and 8228
2 MH.
8 Dat! IincsDat and $$us informaion
Compld pro..durc !o gcft.atcsutus inform.tion. Nc.ds.xka chip. lnJonnxion i3
multipla(cd with dal.l bus.
olx: +J vOD. chip: 80t5 plu! l ch rd
8arcr.Ona d3 MHz
Lre-ord.r rddEls b!! is
nultipl.r.d wirh rr'E d.rr hlE D!t! lin.s
MulriDlcr.n wih dll lovrG
On. ii srrE ar t0EOA.S.ri.l VO lin s.
simpl€t pro.cdur.. Th. linca
So, Sl, and IO/M indic.r.
74 insErctiofii 72 inasEtionriE ssrE .s h dE t0€0,r.
3, Oock Phr..a. Goct Elqrrdy5. Addfttt Bur
5. Dm Bus
?. bt.rn}pl
l. Eria R.rui!.9. Sad
10. lndu.don S.i
Explain .{Sp.cify riWhlt aE:Lis! thc IC
of lhe rdreeds thlrcadin8 hln qucsttI MH2?ln FiguEthe invartln dE SO(s.r t-itaaccefl rlyour afiIn Figtrt
In Fig(
Lisr drErphir'
Imporunt conc.pls rclatcd to tha 80E5 archiEaturr and thc ctacudon of rtr insEtcocrwerc rcvicwcd in S.cdon 3.17.
Thc chaD&r illustmlcd an 80E5-bas.d mi.rocompulcr systcm and analyz.d th.mcmory nap of rh€ devices 8155 and 8755/8355 uscd in thc SDK-85 sysr.m. In add:!i,on, thc archir.circ of rhe 8080A and rhe ncc.ssary dcvic.s to dcsiSn sn E080AMPU wcrE discusscd.
'Iable 3.3 comprEs lhe 80804 wilh $e 8085. i!5 imp.ovrd vcNion. l0 additior:
lo lbe obvious enhancerhents io lhc srea of chip count,.powcr supply! end iequ.ncy.the 8085 hds a mu€h simplcr way of gcncratinS status irfomalion and conEol signllsThe 80t5 iocludes all &c 8080A insEuctions plus lwo mot itsuuctions Elat€d !o -s.nal ,O and additional incrlupi lines.
ASSIGNMENTS
1.
3.
Explain lhe funcxons of ALE and IO/M siSnals of the 8085 microproc.ssorDmw a schcmaric to dcmultipl.x ihc bus ADTADo using dl. 8282 oct l latch.FiSuE 1.20 shows fie E205 (l-to-8) decod.r with th€ thl! inpui siSn.ls:IOi M, RD, and WR from rhe 8085 micropro.essor Sp.cify and namc lhe validoutput slgnak.
ro/El
mwtr
Exphin why four output signals a.. invalid in FU. 3.20.Spccify th. crystal lr€qucncy Equircd for an t0E5 sysGm o opcratc at L l MHr.wh.t arc Zm (Z) ard Clrry (CY) fl.8s, &d wtFn .n dEy sct?
List th! scqucnc. of cvcnts lhat occurs wh.n lhc 8085 MPU reads ftom rneorory.A$umc lhat mcnory locstioo 2075H has a data bytc 47H. SFcify drc conrcntsof thc addrEss bus AFA. rnd $c multipl.r.d bus ADTADo whcr lhd MPUrc.dr dlit locaiion. SFcify th cooEnts of dE progr3m countcr whco dl. MPU isIldilu lix{tho 2075H.In qucstion 8, whco docs th. m signl go low if rhc syscm s
I MHz?ft.qu.ocy is
lD FiSurc 3.10, spccify rhc mcmory maps of the P"'wM and dlc EPROM chiF iftha iovcnc. of th. r(hrEss lin A,r is .liminlcd.h rhc SDK-85 sFtcm, dE sFcificd map of lhc El55 mctnory is 2(mH 1o 20FFH(s.. Fi&r. 3.15). lf yo'r cnlcr . dara bytc .t th. locatioo 2lmH, will rha systcnacccpt lhe dsra bytc? If it rcccprs it, wherc will ir srorc $c daia byte? Erplain
Io Figur! 3.15. sp.ciry ttE mcmory nrp if output liE Or of dlc dccodq tm5 isconEctcd to thc CE ligral. Sp.cify tbc rrng. of rhc foldb*k nEfiGy.ln Figurc 3.16. spacify thc m.mory map if output linc G of (hc dccodcr t205 iscmo..lcd to $c G signai.Usi thrlc imFDvcd fcarurG of rh. 8085 ovr. d|G 60€0A microFocclso..Expl.in dE frDcrioo of lhc syslctD conEollc. in $c 80804 MPU.
.o. t2ot o
^, ;;1, 3:
^" !,E, E, E.
--!.'.1
Iand
This chaprcr Fovid.! ro ovcrrricrv of lb. insau.{oo..r of d|c E0t5,8G0A dictoProac$or. Tha iD.lne_
I tioo r.r d.r.r!!mr fu Fci lEriIlF@I co pcrfotm. Exlrrpl.3 IE tivan ro ilh.tit lrcoI 6a 865 aad dE gEoA dtto!.oaaala.i crccr@I t*rr(lirxr. n|d Ernt ert o innr,rtioa ctcL,I xaiac crlc. ra l-oorr rt efnod.
lo*r.-*la * * ,*. **lrlioo fir'ciidE drt c.a
I uc pefonnoa ty rnc
Itr U, tu nvc ,r.i. !ru4. of ir.au.ridr h tEI tmmmoa inrrnrc*m ra.lO erpnin u ,..-. op-a c.a. {Aco&) yrl
I ffi;-*d*Eltrsby Uriti{.d
F * E{-. crrh, -h. crd.. sln rif o* oes og"lo. h ecrr i.$Edy ir
h m;#.!|- d dE t!.c1rc r-'.dft tf u .ip io
"r""rd"s ff5 l+rt tttd 2-byt
I bErkto.- od a*pldn fu srci.lcd 3it!.1
1ffin"n.*o*L"-aa.r*.me
I ffi#.,.o",*irunns
rt"rc'uttooof "'
-1
Nsrnuc!
i: li"rftrcr{rs lQgE{
tpe{Thcsc ii
-- r{$I
i.flI ceq"II a.ol
l":H
qrlrdt1
N'MUCTIONS}IID TIUINGS
rffi*affi#llffi,These i ructioos Fdqrn vaihuf,lolical op.6dodr with tlic aofladtrof.th! sut rlae.
s.l inclu&r anrn iastrqatie! callad ,.n.ordi ional juhp.
tt
! {e,i&iiidii-aoy &bir.numb.r, o( rhc co,r.',r! of ,$ri.t e or of !d AID,j'; no A .
. I9TE&S.B! ""' bc 9u!3ll flqg o*ig.g-E!"lu!i,c.oR.d fll a- ","','.-.,.,w;ffi€6,.i1rt,,,
:ge{r,ae$ffitr gt.{,-t: oL': ""Itis groug of ;isrructions'"'t,ai" ,t
" ..qr"n"" of po*gnm executioo cirhpr corditionelly(r urronditooally.
Sitrcondidonal jumF arc an imponant aspect oftirr dccision-makilg inoccss iaFoglimming. Tlrosc iostmctioats ta3t for a clrlein aonddon (a,!.. Zrro ortirrr nr!)an,l atrer fie prcgmm sequcNe !*h.n ihe condirioir rs mct. tn airlirior. ftc insrnrcdoli
r'",'t'f
*;lr''7clntilil maaiina fuirCdois nrch as
-l Revi6v, of the 8085/8090A OpelquonsmifilPloccsse opcrarions lllricil !o drir malip{rhtior can ba jumhrriz.J itl tbu!*,lsi -- -{i'-'
F'fofidng erirfuft ric opar!troosFrfonnint logic.l op.ations r
Gllint fq a givco condidon lrd altdh8 tbc Fo8ram iequcmc
I+r.lc, ;'tir*y[ ai rrb
90 Mlcxocolarulct sYsfEM! A.lrD HAtDw ng
Soor td?ona a{aca of tha iffiioo !a ]! Dr.d bcloq:
l. b rb !Gfr, ac'co@ pf ric-rc !r ldJarlmFd: ooly lh. coilcdr of h.d.sir kb r! drr3.d.
!, An l,lo d.rta caa E|,a& or rEirrc da fiio.i tL E&r a6 hr rd ftoh oda!tlhr.l! (crcGpt fo. tiG m.morr.rn rtcd llo d.vicc).
,. .{'idtrtHi. .d losid of.agirna atr Ffoirt|.d nilh dE cdEtr. of ft *c!!i[b..,!d &a rEdta ,t! l|!tl b ti. accrdrtLLa (wi$ ,oc cialpdolr!).
a. An, tt id.r iEtifiog trEtre, 6n b. u..d ffi ircnqEin .rd d.crlrErt.5. A prqru rcqoce cea t cD.GSql cltl|. ciroditionaXy a by lrint fm a givcn
d.la codidl.+-t
INSTRUCIION FORMAT-tk"^
A!lfii.
. tivrn !.*
(rdllrrau bc
Id ri-]'itn".--o.l ,..
o nrut cgircr, r ocriry locrtim, or E.bir aotlGbiri aa"o)t r
te tacold ir indicn. .f_to^
-;*
v
ArL lotiodtoC
lnvatda.a
TLrhdrr al
1, r'^j-!:n'r'r l
4.21 Instiuction Wod SizeTh6.lOEJ/gmA inrmcrion t6 h cbr.if€d i! o rti. f.liooi6 rboa gu4l rcccrtingto tdoad iirc:
ln ft. 80t5/E0t0A,lnic,of qlEtalor, Ho! rvc,.$m !/!rd!.
ONE.BYTE :NS'TRI'C?IONS
li.f Or.dG
Copy thc oosElt of MOvItG.&crlr rbhE IG C.
''byr." rnd "$ord" a! .yltooytFur b.aulc h b !l t.tirirutritirr: :rr corwurly c&rad b in t rE of b.vci diE
Foa cr.Illrb:
ODarrad
c,Alhry Coa. f.s Caa.
otu, nll - {FH
I,gfrrnolc ^xD
rDrNcs
Add t effi. ot ADD Irqid.l B to dr..6!6 of t!ElrlloLlor.
IN€! (codpLfilt) CMAc.dl blt i! tbGr|l l!b..
fhqa ireltad6 ala l.ttE inrdrrctior FfoaDir!8 ltrlr dilfc(.at l.!t!. ln !h.ifitEt'lon. ld o?..!rd tqi*,l 8r +c.ifr.d. I! 6! ..cod intall.iioo, th. op.r.t i. rFcin d od tt *.indtk it alrEd. SirDilrrl),, h lh. rhint iurrrdib, tlt
ir r..ur!d 6 b. !h. iDelicit o?.rrtd. IlE irfiEdo!! r! fqqllhud ir
N$nucltoNst 2.bya h.&udin, 6. n n b,t +.crfr.. |D. oFrd.. c.d. rd ltc r..qrd lrt
rt o?6!!d. Factr,lpLl
.t| t.bit
rh.Fgr!.a'SE6tElr1lloc.-tktr tf,JH.
ddr hyta in thaGlrddaa,
&n ra tbc ddr b!,ta it 32H. Tlt aar.Ebly l&guas! inatlrclion k rrt&n at:
Mlaooal.3 ,Lr Coda
MVr A.32[ 3E ,3UThis io$u.tion qpuld EquiF t o nranory locSioii io ltqr in.nlcriotl.
iITREE.BYG INITRUCTIONS
h a :l.brl! ilrrriEtion. dE filll byr. rpccifica 6a a?codc, .rd rtlc folhvin8 lwo bytdlccily tu' l6bir .&r$- No6 rb! 6. &cood byt i. dE ho-oidc. r,rdrlir .rd dE dridtt! ir lta ldth-oad.r .ddr!s!. For cinnplc:
tB
r- f ,*- 9t
FgG,D(-lg' ,,
0"0
ILrC.d.
2FH
I0@ oqqo,
^PP B
.g'!_-ltJ.l,
OD.od. OFr. dIvlvl A. D.tr 3E Flr,t Byl.
Ihi. S.<rid D',i.
Fi.rt BylcS..oid EyicTbird Br'!e
T.rt
llrCod.
c3t5m
OD.od.
,MP
Of.ild2m5H
92 MICROCOMPUIEN S'YSTEMS ANO IIADDWTRE
Thi. ioshrcdori rvould 'cquirl
rhtc. trr€lhory loarrioos !o rrorE iD m.mory.
Thcse commaods arE in maiyeximpl€. whilc crting in r rcstauranl,
l. Pass (rhc) butiar.2. Past (6e) bowl.3. (Lct us) car.
wrys similt to ou! €varydry convcnrtoo. For*. rrry mr]c thc followinS ltqu4ns .td ordc
4, I *ill havc combin.tion 17 (od tha nanu).3. t will llav€ what Susi. ord.rd.
;
. Thc filol requcst spccifia. lhe cxa.t itcm, it is silnil{ !o th€ insqtclioo for loedinge aFcfic dal! by. io a rc$sl.r. ThG ..cond Equcs( mcllions thc bowl r.d*r thrn thrcoottna, av.n 6ough onc b inl.rlslld rn thc contcnb of thc boil. ft is similrr !o th.inltruction MOV C,A wlicrc ngisten (bolvl3) atr spccificd r.lhar lh.n drE. Th. thirdsutgcstion (l€t us cao assumes that one kaowa whei to cal, It is similar !o thc insttuctioaComplcm.nr, which implicirly assumls thet tha oFrand is thc r€tulErd.tot. L tha founhscotancc, thc location iif d& ilcn on lhc nEDl, is spacificd aod nol thc rdual iEln. lt is
slmilar ro tht iostructiooi trrlsfc. lhe dala blrc from thc locatio 2050H. Thc l.sl ordc'(\rhat Susie ordcred) s sErcificd indir.ctly. Il is similar to in rnstluclio.n lhsisp..ifics rm€mory locarioo (hrough $c roolcnls of a rcSister poir. (ExamPl.s of tbc lasl tro tlFiof iDstrucrion alr rllusuaEd in larcr chapllfs.)
Thcac various ways of sp€ ifrme d.ts .r. ca&d-!!c rddnsdn8_mod.s. AlihouShmicroproccssor instrucdons rlquil. one or nx,rt words to !tscify dE opcrards, lh.trotttions rnd convc.tions us.d in gFcifyirg the operands have vcry liitlc lo do vit\ thc
or,cretion of tha microproaessor. The mncmonic Lilcrs used lo sp€cify a command arc
Iti
I
I]"
tchoscn (somewhat qbirarily) by lh€ manufacorcr. Whcn an instruction irs@rcd in
i? is {or.d i, slq ng
coavenrions used h spe.ifyiag thc itsEuctioos sI€ valuable ln
4.22 Opcode Formotln ordcr to undcrshnd oparation cod€s. wc nead to cxamina how an inslruclion is d$i8ncdirlo th. mi€roproc.ssor. This informaoon will bc us.ful ih cadirg i.{!ct't m3nu.l.in *hich opc.aion cod.s a't specificd i, hinsty lorlnri .nd 6-bi6 ai! divirl.d invadous groups.
ln lhc dcsign of the 8085/8080A microproc.ssor chip, all oPararions. rcgisle.s, and
slatus flags arc dr ifi.d wirh a spc.ific codc. For .xampl., all i[t ma.l rctisLrs a.rc
idcotified as follo\rs:
CodG ltcglltcrs Codc R!8bi.r P.i.t
000mt
00 BcOI DF
8C
.Ii6?RI'CTIOM A}ID TIMINGS
0100l l100
t0lllr0
Dl0E itt{L
icsewcd for
(rmo)C@
Implicitlm00l00 = 80H
.\dd ReB. B
93
tc, i
' flL n.z',AF oR API
Mamory Rclatcd Opcntion
Somc of thc opcration .odes arc identified rs fcilows:
Fuhctiolr O?ar ion Code
l. Rohr. each bir ofth. -0rXxH t I = 0?Haccumulator to rhe left (6-bi1 opcode)by oae posilion.
,. Add rh. conlcnts of a - t0000 SSS .
rrgisr.r ro rhc (s'bit opcode*3 birsaccumulator. aft reservcd tbr a regist€r)
This insEuction is complctcd by ad;ing lhc code of th€ rcgister For cx.rDplc.
AddRegistar B
Binalv lnsnucnon:
1[ rr' *-''
In ass€mbly la 8uag.. this i! .rprcssed !s:
OFode Operurd- Hex Codr
ADD A 8OH
3. IIOVE (Copy) thc conlcnt 0l ddd rrrof rrgistcr Rs (sour!c) 2-bil Opcod. Rcg, Rd. Rcg. Rsto rcgistcr Rd (d.stination) lbr MOVE
Thls inrtruction is complered b) adling th. codcs of rwo rrgistcrs. For example,
Move (copy) rhe contcnr iO .lTorcgidrIcr.E-Ot(ddd)From r?gisttr A : I I I (s!,Binsry InsEuction : 0 I 0 0 ! I I I +4FH
OFod; Or..and
94
-t
l.rcIo@l.,t tta 3l3f8x3 AltD ll Id{lI!
ln ..ra. lf, la!u.!., tli. i. .rFr...d .lOrq& Ot.r-a EiCd.LOV Cr,t 1P
n ... io€dir lt. ffi iqir.r it li. &.d!ri6 d t 6d n8i.r6i. t rdG-fioc A !o C-whli .p?Gat .Gwr$d fd. !d.l rG! noo Lft ro ri!h. fyph.Iy,ir lh. l&al8)A u.cr't rt.dd ti. rb la.ftr (c.?y) i!.trBrbn ir .ho*n .r folhr.:
olllDlDlDlslslsl{OV .1, d.
4,3 How ro wRrEAr\rD aactr,,esupr.u pnoenau
A Dmd&r i! a 6EE of irt&rrri[ wri!.. b tI r cdffi b Efob . rDacifictrIEEl. IL liatnEuE t! ta&cE llm iD rmhEbr Gl oI tlt! tnrcrcrmaalaot. loiffi-r prqrlir, rlivirlc r fivca ptttl h rartt qr h En of 6. ;!..dioor $.m8t$804 c.rl FfolEr, rbr !n!.1& {t r a.p. bb inttrEiE. wririr8 . liltphFSrrn of dCirE two m5. in li. Ilsfifr^ Lrerr.t ir ilh.scd t hd.
4.31 lUustrqtilre Ploonfii: Add l\f,oHardd€dmd Numbea
Pli!&Li S.a.r..t Wdl! i!.trrdo..6 rdd tro bl.dccirtl.l nunb.'3, 32H .nd 4tH,5d ..vc $c u5r,ca h actia&r C.
kotaai Ataa!,- TL Fogrs! to d a,rofl!$.r. co bc *riiEn io yriors wrlrby tdrctil! diffu! ilratid a!ri.$rr ad irtBcriona Elr.d to &ar. rcgir&E.tlou.rtr, lh. lofical arFa.i rill rEra r La. llrnrin |fi. {!E. I i. darcribad balowin ergi*, follo'{d by . fit hii oa t .. .!A. irlo tbc m09fli00A urcrrtly odmahilE l&turtaa.
Ti. r.p. 6d!d b.dd tuollbr .r! l. foah*t:
l. Ldd tt. nu .r !2H ir ol. 0tit ,2. Lad 6a rmbGl atH i! rnottar r!tt!t!r.
33. ADD tia col.rlt oa lta tro l!dra.r.
To t',r,r.* tb q. ib ,!,ttfrly ,,rt 6E iG k',gl,'6,', yoo rlould E ,f.rnili.' wili lt ir,ltucrkr a oa tG gf,rm^ a a t ..s ?i6 tt tE l cbd.fic.li(ro of illlnEtiont d...ribad G!,lir.
.b dd. :tt, rl i..?.dn d r Id.{ Z l iFdi.a - tt i i.ri.- *n .!. -a c.
4 Sat! dE tum ir ltgiLr C.t Ed
-rD. pofrrd.
Ilitt!a
IIIS'TRUCIIOIISAND INGS
hot'..r I lXt&!6eA Af,U, L.!su{. Aft!. n !rin! lhc iisrnEtio{ !cl. ecc.a llosbtc da lotkd aaP. le ..r.l ly Lrgu{c r. fo{oiaa
oF.d. oDrld cEELl. Mvl A, t H Lo.d 6. lnlb.t 32H it li. c{lddna uvt E, ,ltlt ,rd e. sob.r atH h tldr.E B!. AID I i.tu! Ua cooLI! ol lltLt I b lia
. .o!!tx of dr s1llndnt. TL rm' b 3o.td h th. sl|dd&..
4 lrcv C, A €opy t rl& ft6li. Elouls 6
95
rlSix.r C
fnd of lhr Fotr.rh
?i!rr f f&*. I{rry By bokin3 ry 6.6.Enir co& io. d i.t{ciE 'h ]hr inaladd c, ?r s r.ndaE tta liot tl lao mrcihc lrajugr u follo*l:
Y
Mrandf!.L MVI A,
!2ll,. MVI B.
,tttlt: ADD B-a.Movc,Ag. lrLT
llrclb codc (Ilq)3El -.3, I z.Dyc orEudton
[]rn*,,*,-.-t0 l-byr. i!fircliol|4F I'byr. illlaucdoi76 l.byE itunuction
Hot l! ELt..d E&.oL. Prear.dh. Shfk-lortd lrlsoPoLr *t .!.rls.tut }!u b.tr r .iEtt bo.rd lhicN.orent . cqlipf.d *ith r lttr k ybo€rd .!d &\YdEar. IrahE tha !ao,t!n, *LEl ! natno* localior-Fcflrably, d|G riBl tltcl!|oi,toclioddrb u*r 8/W rcy .- !!d a6lcr tb. Fqtr.n ra$rciti.lly. Fo. cr.nPL' ft.bovc Folr.m ir $ol!d a db*.:
Mr.odyfE&.
20@
2mtN2N3
tlb.., Co.Ld' H.rL lb.r, Cod..
0.0.1.r.1.1.1.00,o. t.1.0.0, 1.00 0.0.0 0 r t.0010010001.0.0.0.0.0.0.00,t.0.0.1.r.1.10l I r0l l0
06
2m4
2005 4F
96 MlcROCoMPuiEt Sr/llllils AND HAnDWA&E
B-
Rr3a{ lha sy$e6.DiEcl tl lul.roFocr$o. t*.rt yoill D@grxn bcSirs bypushi4 rhc apFop.iatc kcys.
Exccuta ha program,
AchdiscrlerE
f,n-
1..-I sir I.
I ,,,-L'.!.IS.Clq.ci! ta
kog n Eracutbo Whco the mimFocessor is dirccted to tttc olclDor? locatiotr, 2@0H, it b.8ins &c pmttam.xdutiod by fc{ching $e frsl machitE cql-TiE Prccrssor
dccod.s dlc codc by In.tchinS it vrith ils prEdcsignei s.t of mstruclions, ard F.rforErs thc
fuoction spccificd in lhc cod.. Tbc microproce$or contimcs this proces! se{ucndally, orl.m.mory locsrion t6 r& ocrt. uflil ir is dtlcred to h.h. Thc limiog dclails of thc .rccudonof ln mst rcuoo arE &scnbcd larer.
Rlautt Thc.nswcr of your additioo (32 + 48 3 7AH) is. foond in tY/o.ltiste$-d& rccomul.tc nd lllistcr C. Evln if the sum is tr.nsf€Ircd tlm $a rccomullld toGgis&r c. 6c con&orr ofth! tccumolalor arc ml dGtoyrd (R6tEnbct, ir dau tnntfcr,lh. sourEc is oo( dcstroycd). Hor|.vcr, thc ans*cr will ma b. disPlay.d rutonric.llybcca$c lhc plogram d€! ml isclu& an OUT insttuclion.
4,4 INSTRUCTION TIMINGS AND OPERATION STATUS
A program or instructiont arE stored h lhe rncmory of a miclogotBPutar. To cxacuta aD
in$rircrion. dlc MPU fiusr Iocarc lbc rhcmory loaaiioo. fctch thc code vie th. dll3 bus,
d.cod. ir in liE insBu€lion rrgi$cr, and pcdorm th. functioo spacificd in dc co&- Th.s.r&$r ricll dcs.ribcd m & lan chsptci ar "Fcich. Dacod.. dElxari&'b 2' aad lbvtj
tlrc
cod.. AI thi-E;ffi pc.fonn€d a!. givcn mqtsnt 5!4 witin r$v.olhc clocl of
Opcodc Fctch (OF) 0Mcmory Rcad (MR) O .
Mcmory Writ (MW) 0UO Rc.d IIOR) It/O Writc (lOW) I
4.41 Exgcution ot an ln$ruction (8085)Thc mts i&nrifics its v.rious oparalionr. c lcd D..hlDe cycl.., lhmugh thc thrc. sla$tsignals IO/M, So. and S,, as fouows.
Slrlut Colttrol. Thr t085 oFr..locr lo/ti $ $ m W[l.
3.4.5-
lt0lt00l0ll0l00l0ll0
- -:t"l
INSTRUCfIONS ANO TIMINGS
Th€ followinS Gr.mples illustraE. rhcsc (ooc.pts.
t[. ilrl0r&iioo MOly C,A (ao& {FH} is srorcd d rrftory loc.dor 2OjH ircf.. b
M.i!tL..lb. (ll)
S..tioo 4.31, Utulrt irr PtDtr.E). Thc rcufiulilo. h,3.drtr bytc ?*H. llhrEla ttl.cf,aaulioo of dlc in€trcdon &d.c.lcuha thc cxccutioo timc ifth. syltain.hck lilqucncyL 2 MHz. ..in'
I
. ln iddition to $cs. op.r6tions, ihr 8085 p.rfotrns otlrcr opc:ations, siriir as lnrcnupA.knowlcdlc (s.! Table 3.1), *hich ale ommi[cd hcre for thc srkc ofcl&ity. Bcforrdiscussing lhc riming'and thc cxecudon of rhcsc file opeErions ive nced to d€iinc dxlctetms: insruc(rcn cyclc. machina crale. and T-state.
Instructlon (Vcl€ is dcfined as rhc trma rEquirad to complete rhe .xecurion of .rnc /
in$ruciion: Th. 8065/EO80A idsttuctioo cycle coosists of orlc ro five m.chin .yal.s or .-.r'or,a lo fivc oFErations,
M.chtnr .yda is dcfied a! rhc omc rcquir.d lo compl.te thc oFration ofrccrsrng cithcr roqnory or UO. h (he $E5. dlc machin cycle may consirt of rhr.e. !osix T-star.s, and rn dl. 8080A, 6I!. t, five T-star€s.
Tdatr is dcflrEd .s ooc subdivisioiof rlE opGteaion perforncd in ooc clock pcriod.Tksc sobdivisi{ifarE intcmd satas sy.chronizcd *ith thc sysrem clock.
Erqmple4.1
2005
Thc cr.ertion of dl inshrcrion! is s.4uanc.d b.v lhc prolra{ .ou r.. Bcforc lhc cxc-cutiotr of ah i[struction, its nrcnrff/ &UJ.st musr tE in [E [rotlam couoocr. lt is rssumadhrc drlt dlc insrtucdoo hcrcd { dE Flvious mcr.nory locatim 2q)4H is elrcdy.r.-qtlcd! fDd th$6a p.p!.rq ccqrt . h.5 &cl&rrs 2oo5H.
Io cxccurc rhc insrultion tocica et XiSu,-m filo*ing scq*o"" oL" ,,o(sc. Figuc 4.1):
l. TIlc MPU placcs th mntcnrs of lhc progrlm counEr (2m5H I on th. address bus, ZoHon ahc hiSh-ofilcr blls {nd 05H oll {E low-qds bus lD-Atb.
2. TtE MPU cau.cs ta ALE sigrd b Co hithi dr{ c.a b. !$cd lo dcfiulrrDlcx fte bus.3, TtE MPU ind.ntifics th. !&rrc of dr r!.dlirE cyclc-Opcodc Ferctr flnsnuction
.Erch)-by lsing $c irdlls siStr ls (IOIi - O, S;= l, So= l)
Sot'ution
During Tr, ftc MPU scrds {E coiuol siglld nD ro cDrblc ncmory ad incnrrnrinc Fogr.m couract by I b ffi. @
MICNOCOMPI'IEN Slst T's AI|D 8AnlfdARE
i'l\ ,,(! l
\!\( l"*)
Sladla6 da"ll{
Y\t' cf-'Edi *fO *le
D![ rcno'q ArD rrmo.es tf,' ' **u/ l' J 7t'
E,EL.- t. 20I . lE XVI A. lin2or $
llrh h* rqdc. rc & crcfr rlf. Ed d rrt! TG lL rLl.& c:,rL" tal, b h T{c., -d b tFdd cFh, t4, b ltt T{5(El!t..D.
Ib rd* cy.I L, b ihi6.d . e OfEd. FrC .Fl. !, & ia!.bfOE - 0, S, . l, d 8ar l.:hrr L c T'. t hia!'ad.r.d&!.. (2OH) If5aat5A.rA.,Lbi&6(ol0brhdrlbht|AD,-AA,d-ALaUhLd E!d.) rt!.|i. d.tpltl L L..E B- 6. c drhdE E br. d l! l5 6[8] iqr fi ErE' lo.d6 rm.t d.. d.|r.l E rf, br. 0EA) tqr nr uru;locdo ffi tt ifiilora-.h., tb hl!,d. bcoeLa i .. r.lt dli.hr*ba.-htr&L, Ddrf O.rTob.mCt tr a*ot.
Ata
ld,gl,.l
b
99
ma.ta5$iruUou oan t!fiicb! (wtA &l tl)
i
loe dl
100 MranocoMPurER gYsriMrAND HARDW .R!
T'h. ffdria c'yclc M1 rniir i. ilidltil .r . lidra, Rc.d cadc GOfr - o,, S' = l, $ - 0), b .ioihlibH, cych: frdris cycLt li. illr!* z(I,tH b pLcGd oo
rh t ! l' in M', 6e rh byr O2tD ii faded vir dlc &4. bos, rtd lh. in,tsl&{oc i!cxccttd rtudng ttc T1rlnc. MehiE cyclc. Mr rl|d lit.r! imil.r rcy bolh FtformttMafiory Rrad function. Ho*!vca, tha 6t!i mrhinc crclc oflrch inrtsuctioi i! lLniifu.rrb..OpcDd. Rlct c:d. nt t lt.n lt M.lEry Rld cFL, '
. F om thc two ardmplcs abovc, wc crn 3utnfftir. lh. foUowing points:
!. ftG inrmcdoi crclc tdriilt! oftc arqltioi of ooc oa mol! llilahinc cyclcs, rtld dl.. crco|ti(ri tinr ir d.l!flrlH by tti. T-rutas.
n!. l.byt -iiElrim cFlc ir dcfirEd as dl. !.$.ncc of opc ioi. €$riEd to coflplelr (,lc
'irf rh futl.ridt!..3. l'llc T.st tc li-ir intarndly d.IiEd A.trtioi rnd i5 sFtuleiz.d lrilr 6. iyi_
tan cloax,a. Tl tyF of opcrxioo ir idcotificd rt thc bclinltirg of: n chi!. cyct. by lfic
$Ius si!nrl!.3, Th. conEol signel idcnrifias thc timin8 ofdE op.ratio!.
X 4.42 Erecutlon ol qn tnslrudton (8080A)Thc cracutoo of an insmrclroa h dlc 8Ot0A ts somc*h.l niorc comPlcr U.t in th. 8O€5.
Th m80A h.s r 2-ph.!. clo.k, .nd 16 cP.rations ar!-ircntllicd by hc 8'bit .lalu6 on lh.. dau bus. Tl* suNs codcr ur d follows :
!
n|IbE
OFr.doI' OFcld. Fctch
. 2. Mcrtoq Rard3. Mllroq Writc4. YO Red!. Yo WriE
sa*i codr
A2H. 82lt
MH42Hl0H il
uR
loc lht r l-b./r.lFrrrdd,lnsXTHL liar 6w o*hhc cFl.s.)
Ednpb{3 2dDH .rld zIDIH l' it Erstdc 4.2.
ttE cr.Eltioo of lhis iFuction k ia ul.t, *.y! sii ld o tha arccudoi ot ttc itlstuclioo*ot}n i! Ermplc 4.2. It nquirca t*o mEhill. c,'€16 {ith r loul of savcn T_ltatss.
Frgutc 4.3 shows rhat ttc bcginDi[g of . mshi* cydc i! ildic.r.d by lb. rytrc
Fft., riaiLi !o tllc ALE sitdin dE EOt5. At Tr, tbc micloFo(lssor Ph.!. &G rddrcsi(2GOoE) oi 6. .ddlsr b{s rd tlE o?r.don g{us (Opcldc Fctch -A2H)
oo tit drohl'. Tha t22t contol.r
'r.6 lbc aFc F .c 6 Lt h ibc tll[tt.
Sohrtlon
TND IIUNGS
l
t
td2 MICROCOMPI.IIIR SYSTEMS AND }I^RDWANE
-;7r.).8$t L-hi r. cr.k.
4,5-'
'lemr a.a
CorrFolt(h i, lh6 8085 drd flre 8O8OA trl.tuctto'r CYct..tdJf,CE irh Alc. .i Crry Ye a. a ,lt taq,@e lt*t rrar!t-!, d.. od ,rffiftEt.lXl), p. +t, t?, llFBd qrt F ..i..
2, EoOi Foai5rors rcquiE s. ro fivc mr.hinc cyclc6 to ctccrta ai inrtrrtio Mr Ln€(!.s.ry for.ll iolrnc,iions. +-L M
3. Th.80t5 Mr cycle has four io sii T-srd!s, rnd lh. t08OA Mr cycl6 h.l four 6
4, In lhc aubscquent mtchrrc cycles, thc EO85 rlqurrcD only thr!. T-rillcr: ll$ 80804. .rthc odl; h!rd. rcqurBs toor !o livt T-surc!.
q-5OVERVIEW OF THE 8OE5/8O8OA TNSTRUCTION SET
:*?f;. g,i{'":Ti TI r. ttjtli r, lr: lrr J1 I r! r.lr,lr. r,l rr T: I1,
(b) 8d0A M.hir Cr.k.
:ry'k'lrlar 7
=7q.t+(
Th. t0t5 microFlc.stor lnsEuctioo scr hss 7a opcnaioq codcs rhs! rctuh irr-?lllnlGlEiidE, Ttc 5cr iicltdct all rha.8(){loA htalEtiro! plot t*o rddidand lnnru.ilo6IlJ ad RJM, rcllcd o lcrid l,/O). l( ia 6D ovcMh.Ini[i crpcricnca for a badnE Fsudy dEaa irstrEtiqlr. Y(lr .lr suontly ldviscd iot ro rtramF lo ,qd all thlsc inslluclk)o ora tiDa. Houcvcr, yos should tr rbla b Imtp aD ovcrviaw of d. rd bycratninin! dE ilquartly ulcd irltnEtbn lidd talow..
Thc tollo*io8 oorations ar! lscd in thc dalcriplioo of lha inrtdcdona.
= ad8s,,to8or &bii R.ei;= MEmory lrSidrr 0oc.tioi)= Rc+tlr rouEc= R.8k rd.ltineti6= RcEktEn oair= conl.li.s of
iTll.. i6lll<ric eidri- -d ttr|'.l.a b ri. ai m d.Fa llr EPLr l-cbr i ..rpl.ii.d .lth.bcrk.tl, in AB.dn f f6 ...y rtfalrl.r tu &.idit d. bhd.. .br hl! .t *!xin
nnai6 .lr.rScd r.dtir.t io rh. tuodidl h.!.daio.l !.qBE ot *!ilI cod... &d rlrbakal !b.
R
MR!tdR,P
()
INSMUCTIONS AND TIMINGS
CMP R,/M
' c?r 8+it
4. Bnndr iLst0ctions:
JMP l6.bit Ad&E 3
Iz ltrit Ait&rsr
JNZ l6bit Ad&.ss
!la. Jc l6bi! Ad&.ss
t JNC l6bit AddrEss
CAI-L lcbit Ad&tss
- RET
5. M*hirc c-oouol ioslinctions:HLTNOP
Cdp.t! 6. cdr&'la of Ggi*thE,,/fiywidt tta conrlntr ot iE srlr|rihln forb!. tli.r, aqurl to, oi nlo(! ttlat.
Cofip.E $bit dd. *i6 d|c .oitcnti of furcc0mulator for lala th&, cafd ro, a'rmoll lhl,r.
ctmgc rhi prograia scqucnc. lmconlditionatly.
CtrnS€ dr fiogr..n sr$Encc itsp.cifrcddrts coiditiodr ir!'fut.
Changc dc prler&n saqucrrc. !o thc loc.donspcciicd by lh l6bit addEss.
Cltrngc lhc piqr.m sa|ucllc. !o lhc loa.tionspccifrcd by thc lGtnl add.rs6 if lhc Z.toflrg is s.t.
Chiog! lh€ program scqucncc to thc loca(oispccified by *& l6bit addtlss iidD ZEroflag is rE&t.
C'hrngc tlE Fogr.rh s.,tudi! ti thc localion' spc.ificd by lttr l6bn .ddr!.is if tltc Carryflag is !!r.
Cha{gr thc program scquaoca to lhc loartionsFcificd by tllc l6bit addr$s jf iIrc C;ryflag is reset.
Changc thc progrrm scquencc lo lhe localionof a subroutinc.
{.€tum io thc calliDg proSram altcr com-pletint thc subroutihc s.qrma.
Stog pioccsring and wait.Do nol pcrform ,ny oFration.
105
g
Thi5 sat of bstsu.lioor is | rcf,rcscnlalivc srmph; it docs nol includ. vir1.ous
-$arioor rlldcd to I6bit dat! oFr.tions, sdditional JurU insflrctibns, and co.ditioelC.[ -d Rrtul! illrnrcrions.
a5l How to Recagnlze'Nunberol Bytes lI}ctrl lnstrucuon
t E bcoc fullid {,i6 irltnlctirtrr .od bcgi[ to rrlc ttsn il *riting progrem to be
dad orrualr, wc 0.rd to tml, dlc numbct of b/!6 Gquirtd for . givco iolquction.I i cry ti rititc pogrrrns if wc can fiod a wal lo &cognizc 0t aumb.t of byics in an
. -Ei(a
virbou looknog up lfta in3tsuction lisr.
106 MlcPoco0rPt lEl s6rEusaND x^nDulaE
lt rr r! E h d b rtLt b lLtiif, dE !En$.r of dyrcr io ra iruirrc'tior'hr alr fuca b furd tt .rttfnilt dE iotlllcirl !.1.
t. Ib rafcr iarian drr co?t b cdt ats from @ Ilgi!c.. (o. rrmdy) itrlo
dp nliE (d tEtur) rt l.bl,t itrrnrak,l5.Eranpb: r,{OV
' a ArirEtaicloSi. iE r ci..E riGau tc clditB Lnat l.rc l'bp intnrl.don!.Eror&rr ADD, SUB, Of,A, ANA, INR' DcR
DG[ffitrl8l. btEli(r lti lod d alindr. &bii d.rr diEcdy .t! 2-byr. ill.llrcriont.! Ib aaicn GFarrlly ,t!.t G.trd by fiftc loo.r. wi$ lh. ardi8 lcE I
&.i&rj Yvl. ADl. ANl, oRl (Erc.Ftor: lts LJI inlolcrioo!)
l. ffilxd6 lhl lod 16 titt a rtfcr ut ,lcqory rdd.s.6 nl ]'by!. ioer8tio6'Ezrylor LXI, tMP, Codirioo.l JutlDl' CALL
Althoodr lhct3 .mrB .r! r.cnlly rppticruc, lll.y m.y nd4pry io 'll
lh'irrlneribn! h 61 ..l. tl,owtttt, ltt& ndc. of thur w l b. u*fuI in lh. ioilid c.t!.of *riting lroSrn!. Ancr *ritit{ a fa, FoltMs. Fs xdll t gi! io t c th. ,alattr ttdwil ba at* lo llcoitrizc &a ttnbar d b!i6 rEquiild for an in$,ction'
SUMMARY,
nir chdlr dr.sibrd lh. tbr. nrdF rion tuction. of lfiG $85/r080ArrkrFocarta. Eovid.d a! ovcrvi.w of lhc it6Blcrior a.t' ld ilhttalal dlGr.cntbn d irrtrdrorl. in llhirn lo thc ry.r.m'r chct. Tt inDollttf, c(nclFi. dir ct{..t cls b. uno.tiud lt folbw.
a Tb iS'liOoA microp.oc..td oP.trtidts .!c cluiifi.d i!6 fivr llrfrtrut : dr. [.fitcr (.o?y), u hrat, logic, bdtdr' .fd tn .ib odd'
c lt ir*rcfoo ir tso p. : qcod. (o!.t tiotr b b. Ffo.tEd, .,d '?'i!d(dd. io b. ooctd qli Th. q.nnd ctn b. de (tj or l6+it), rddt's' rctid"'d ir c..n b! impli.,r. Tla ftlH of tpacit ng e o0rod (diE dr' i**rly'.L )
E cdld tb dd'l sirt nodcE Tb irir&&n !.i it c-hiiif.d in drllr Itolt!6 *c(di!a o li. {'o'd
'izti l', 2.'
a l{!r Le\rda,r!.
INSTRUCIO.I$ AND TII'INGS
tr Towtit all sscmbly lanCuassfllsr.rn, Svidc Evc!.prob.hs ialq sdllst p. irlaaru of {E rDkiop[occlFor oDal'lild3, Ernsh& {tc* {!?a iDio raacfilrlX lr$gulSEh.Eucrbrls, arld thcn [aniLt dEn nto d! !08r8$0A erhi! cod..
tr Th. iDrEBrio6 cycL ia d!fio.d ., rhc riB rlqrilld,b ce@plac tta lre&ro .f rointtructioq it coruirfa of yriq|r 6rah&l. eycl€. Esh arLb clcta ia r aiam-pilc.laor opqltiotr mda u! of vriors T{llt . (Gquivahor !o dl. clel p.dod).
tr It mr.hiic cycl6-Opco& F.ch, lttcrrMy Rrrd, M.ay WriE,lr0.&ad, .!dVO WriE-rE filquanrly uld by rhc micrnDroca$r I! ttE t(!5, th. El8hiEcycE .r. k .ffird by rh. ru!u. tim.l.loil; S." od Srr h tu dXlA. dlc;cycb lr. kLhtfird by rh. !Atu. ttml.ldtrIl $, od 3r,; ttr 6t t(Xli,.th ;.rchiB Gy.L. re i&Drifi.i bv rhci[ dE t+[ rmr .oda o! tL dr. !l! .t 6.nrtrtrr cyd€ rir idcndfd by phcirt ilnr *ibcjtuiq oltfie r*br cplc.Uattnliq ofdra D.ctia .r!ic.
O Thc nicopocauc rndr out .tr sppropdrE cod d< ro'lddtfy d*tirdrldlnirl8 ofc..h mrchiE cych.
ASSIGNMET.ITS
.lo7
L Ust the folll cscgorils of m85/8OmA insitucriofi3 rhrl , rnlFrhia dttr.2. DcfitE opcod. &rd opctar , .nd spccif, thc qcode ard tha op.f,lld ir tbc
insErrclioa MOV H, L.3. Writ tlF DuchirE coda for tlE insEoctiotr MOV H, A if $c oFodc = 01. lhc
rcgist r codc for H = lo0r, .nd rh! rigislcr coL for A = I I I -
4. w'ilc dr. E085/t080A orcmonics aod the machioc code ao t4nsf€r ihc Fogr.ms.qudra! !o thc lo.stiofi 0155H.Dcfi&: iDsEuction cyclc, machinc cyclc, aDd T-stata.C.lcd.c 6. ti[E llquilld to cxccu!. thc follouing two iadruc{ioG if &c systcmclock filqucdcy b 750 kHz:
5.5.
MOV C, B
JMP 2OJOH
5 T-$acr
l0 T-sr.tcs
,. IllusEr& thc contcnts of 6c ad&cas bus and Ulc datr bus widr rc!p..r ro rllc sys-lrE clo.L iD atr EomA sysr.m whln rh. fouowirg insEucuon is cxccutcd. Showtbc
-eprop.id! cooud sign.ls.
iftEGy .!rrhh.Addng Cod. !,lncrloi.t
m5lm52
Coonrot
Add F2H io dE codirn$ oflhc ac1rliirlatfi
C5 ADI. F2HF2
r08 MICNOCOI'!(,fEN SYSTEMS AND HANDWANE
a. trhsre 6. cGolr d ria ddE . bur rd &6 &r. trrr' art dtc tinring of lh.caol'r[rb ia a U5 .r!a. r,t .rtc in.trldiq! i! q!si[ 7 i. arrcu!.d-.' Stor tu btlc t trcB oafi. rir.L I(y , So i[d Sr.
t, ffif? bfr.i tilt b d 6. blbrilt t*o IGr @!rba5. Bodr ri. nlrnbq8aold ta.aa!!r! fa IUIG o!. Srtr tia 116 io ih acqrmlbi
!ard..G A2H d AH
ta Brb FlSr.o i! Qc.{ir 9 iio rt .m8'rflloA l..dbly lr!to.g.,ff. b !r:ztrl.it ed h r!!iE B rd d.r. bric yrH i. ndld in 6G ElDr-
l&, Slirr ta ffi of i!,!Er B, C, ntd ri. g{dhr .k tb er.qd6oa i. hryla lro lrttsi.:
I{OV A, B
ltov c, A
r{i
Recommended