Microprocessors Notes 8085A
Microprocessors Notes 8085A
CHUKITECHNI
CALTRAI
NINGI
NSTI
TUTE
MI
CROPROCESSORSYSTEMSMODULETHREE
8085MI
CROPROCESSOR
-
Thef
ir
stmi
cropr
ocessorwasi
ntr
oducedbyI
ntel
co-
oper
ati
oni
n1971.Thesewasa4-
bi
t(4004)andan8-
bit(
8008)i
nthaty
ear
.
-
Lat
er,
8080mi
cropr
ocessorwasi
ntr
oducedwhi
chhandl
es8bi
tsdat
a,16bi
tsaddr
ess
l
i
nesand16bi
tsst
ackpoi
nter
.
-
Theyar
ewi
del
yusedi
nindust
ryasagener
alpur
posemi
cropr
ocessor
.The8085
mi
cropr
ocessorwasani
mpr
ovementof8080wher
etheyr
educedt
henumberofI
Csi
n
t
heci
rcui
tsy
stem.
8085PI
NDI
AGRAM
-
The80858-
bitmi
cropr
ocessori
shousedi
na40pi
ndual
-i
n-l
i
nepackage.
-
Thedi
agr
am oft
hePI
Nisasshownbel
ow.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
The8085mi
cropr
ocessori
scapabl
eoft
ransmi
tt
ing16-
bitaddr
esst s216=65536
hati
memor
ylocat
ions.
Thedat
abushas8bi
ts(
1by
te)t
hati
sthewor
dsi
ze.
ThePI
Nnameexpl
anat
ions
A8-A15(
Out
put3St
ate)Addr
essBus:Themostsi
gni
fi
cant8bi
tsoft
hememor
y
addr
essort
he8bi
tsoft
heI
/0addr
ess,
3st
ateddur
ingHol
dandHal
tmodes.
AD0-AD7(
Input
/Out
put3st
ate)Mul
ti
plexedAddr
ess/
Dat
aBus;
Lower8bi
tsoft
hememor
yaddr
ess(
orI
/0addr
ess)appearont
hebusdur
ingt
hef
ir
st
cl
ockcy
cleofamachi
nest
ate.I
tthenbecomest
hedat
abusdur
ingt
hesecondandt
hir
d
cl
ockcy
cles.3st
ateddur
ingHol
dandHal
tmodes.
ALE(
Out
put
)Addr
essLat
chEnabl
e:
I
toccur
sdur
ingt
hef
ir
stcl
ockcy
cleofamachi
nest
ateandenabl
est
headdr
esst
oget
l
atchedi
ntot
heonchi
plat
chofper
ipher
als.Thef
all
i
ngedgeofALEi
ssett
oguar
ant
ee
set
upandhol
dti
mesf
ort
headdr
essi
nfor
mat
ion.ALEcanal
sobeusedt
ost
robet
he
st
atusi
nfor
mat
ion.ALEi
snev
er3st
ated.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
SO,
S1(
Out
put
)Dat
aBusSt
atus.
Encodedst
atusoft
hebuscy
cle:
RD(
Out
put3st
ate)READ:
I
ndi
cat
est
hesel
ect
edmemor
yor1/
0dev
icei
stober
eadandt
hatt
heDat
aBusi
s
av
ail
abl
efort
hedat
atr
ansf
er.
WR(
Out
put3st
ate)WRI
TE:
I
ndi
cat
est
hedat
aont
heDat
aBusi
stobewr
it
teni
ntot
hesel
ect
edmemor
yor1/
0
l
ocat
ion.Dat
aissetupatt
het
rai
l
ingedgeofWR.3st
ateddur
ingHol
dandHal
tmodes.
READY(
Input
)
I
fReadyi
shi
ghdur
ingar
eadorwr
it
ecy
cle,
iti
ndi
cat
est
hatt
hememor
yorper
ipher
ali
s
r
eadyt
osendorr
ecei
vedat
a.I
fReadyi
slow,
theCPUwi
l
lwai
tforReadyt
ogohi
gh
bef
orecompl
eti
ngt
her
eadorwr
it
ecy
cle.
HOLD(
Input
)
HOLD:
indi
cat
est
hatanot
herMast
eri
srequest
ingt
heuseoft
heAddr
essandDat
a
Buses.TheCPU,
uponr
ecei
vi
ngt
heHol
drequest
.wi
l
lrel
i
nqui
sht
heuseofbusesas
soonast
hecompl
eti
onoft
hecur
rentmachi
necy
cle.I
nter
nal
processi
ngcancont
inue.
Thepr
ocessorcanr
egai
nthebusesonl
yaf
tert
heHol
disr
emov
ed.Whent
heHol
dis
acknowl
edged,
theAddr
ess,
Dat
a,RD,
WR,
andI
O/Ml
i
nesar
e3st
ated.
HLDA(
Out
put
)
HOLDACKNOWLEDGE:
indi
cat
est
hatt
heCPUhasr
ecei
vedt
heHol
drequestandt
hat
i
twi
l
lrel
i
nqui
sht
hebusesi
nthenextcl
ockcy
cle.HLDAgoesl
owaf
tert
heHol
drequest
i
sremov
ed.TheCPUt
akest
hebusesonehal
fcl
ockcy
cleaf
terHLDAgoesl
ow.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
I
NTR(
Input
)
I
NTERRUPTREQUESTi
susedasagener
alpur
posei
nter
rupt
.Iti
ssampl
edonl
ydur
ing
t
henextt
othel
astcl
ockcy
cleoft
hei
nst
ruct
ion.I
fiti
sact
ive,
thePr
ogr
am Count
er(
PC)
wi
l
lbei
nhi
bit
edf
rom i
ncr
ement
ingandanI
NTAwi
l
lbei
ssued.Dur
ingt
hiscy
clea
RESTARTorCALLi
nst
ruct
ioncanbei
nser
tedt
ojumpt
othei
nter
ruptser
vicer
out
ine.
TheI
NTRi
senabl
edanddi
sabl
edbysof
twar
e.I
tisdi
sabl
edbyResetandi
mmedi
atel
y
af
terani
nter
rupti
saccept
ed.
I
NTA(
Out
put
)
I
NTERRUPTACKNOWLEDGE:i
susedi
nst
eadof(
andhast
hesamet
imi
ngas)
RDdur
ingt
heI
nst
ruct
ioncy
cleaf
teranI
NTRi
saccept
ed.I
tcanbeusedt
oact
ivat
ethe
8259I
nter
ruptchi
porsomeot
heri
nter
ruptpor
t.
RESTARTI
NTERRUPTS
Theset
hreei
nput
shav
ethesamet
imi
ngasI
NTRexceptt
heycauseani
nter
nal
RESTARTt
obeaut
omat
ical
l
yinser
ted.
RST7.
5~~Hi
ghestPr
ior
it
yRST6.
5
RST5.
5LowestPr
ior
it
y
TRAP(
Input
)
Tr
api
nter
rupti
sanonmaskabl
erest
arti
nter
rupt
.Iti
srecogni
zedatt
hesamet
ime
asI
NTR.I
tisunaf
fect
edbyanymaskorI
nter
ruptEnabl
e.I
thast
hehi
ghestpr
ior
it
yof
anyi
nter
rupt
.
RESETI
N(I
nput
)
Resetset
sthePr
ogr
am Count
ert
ozer
oandr
eset
stheI
nter
ruptEnabl
eandHLDA
f
li
pfl
ops.Noneoft
heot
herf
lagsorr
egi
ster
s(exceptt
hei
nst
ruct
ionr
egi
ster
)ar
e
af
fect
edTheCPUi
shel
dint
her
esetcondi
ti
onasl
ongasReseti
sappl
i
ed.
RESETOUT(
Out
put
)
I
ndi
cat
esCPUi
sbei
ngr
eset
.Canbeusedasasy
stem RESET.Thesi
gnal
is
sy
nchr
oni
zedt
othepr
ocessorcl
ock.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
X1,
X2(
Input
)
Cr
yst
alorR/
Cnet
wor
kconnect
ionst
osett
hei
nter
nal
clockgener
atorX1canal
sobe
anext
ernal
clocki
nputi
nst
eadofacr
yst
al.Thei
nputf
requencyi
sdi
vi
dedby2t
ogi
ve
t
hei
nter
nal
oper
ati
ngf
requency
.
CLK(
Out
put
)
Cl
ockOut
putf
oruseasasy
stem cl
ockwhenacr
yst
alorR/Cnet
wor
kisusedasan
i
nputt
otheCPU.Theper
iodofCLKi
stwi
cet
heX1,
X2i
nputper
iod.
I
O/M(
Out
put
)
I
O/Mi
ndi
cat
eswhet
hert
heRead/
Wri
tei
stomemor
yorl
/OTr
ist
ateddur
ingHol
dand
Hal
tmodes.
SI
D(I
nput
)
Ser
ial
inputdat
ali
ne:
ist
hedat
aont
hisl
i
nei
sloadedi
ntoaccumul
atorbi
t7whenev
era
RI
Minst
ruct
ioni
sexecut
ed.
SOD(
out
put
)
Ser
ial
out
putdat
ali
ne:
ist
heout
putSODi
ssetorr
esetasspeci
fi
edbyt
heSI
M
i
nst
ruct
ion.
Vcc+5-
vol
tsuppl
y.
Vss-
GroundRef
erence.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
8085MI
CROPROCESSORFUNCTI
ONALBLOCKDI
AGRAM
Thei
nter
nal
archi
tect
ureofmi
cropr
ocessorhas8bi
tsi
nter
nal
dat
abuswhi
chi
s
bi
dir
ect
ional
car
ri
est
hei
nst
ruct
ionsanddat
abet
weent
hedi
ff
erentr
egi
ster
s.I
tal
sohas
addr
essbus.
1.Pr
ogr
am Count
er(
PC)
Iti
sa16–bi tr
egi
sterwhi
chholdstheaddressofthenexti
nstr
uct
iont
obe
executed.ThePCgoesthroughastep-
by-
stepcounti
ngsequenceandcauses
theprocessort
oreadsuccessi
veinst
ruct
ionsprev
iousl
ystor
edinmemory.
2.I
nst
ruct
ionRegi
ster(
IR)
Ithol
dstheoperat
ioncode(op-
code)by
teoft
hei
nst
ruct
ioncur
rent
lyunder
execut
ionbytheprocessor
.
3.Cont
rolandTi
mingUni
t
Itexami
nestheinstr
uct
ionbyteint
heIRandimplement
sitbysendi
ngoutt
imi
ng
andcontr
olsignal
stootherpart
softhepr
ocessorandbey
ond.
4.Wor
kingr
egi
ster
s
Iti
susedt
oholddatai
temsthatar
eprocessedwit
hininst
ruct
ions.Theyar
e
sevenwor
kregi
ster
snamelyA(accumul
ator),
B,C,D,E,HandL.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
The8085Mi
cropr
ocessorf
unct
ional
diagr
am asshownabov
e.
5.Accumul
ator
TheAccumulat
orisan8-bi
tregisterusedforoper
ati
onssuchasar
it
hmet
ic,
logi
c,
l
oad,st
oreandI/Oinst
ruct
ions.Itisthepr
inci
palworkregi
ster
.
Regi
stersB,C,D,
E,HandLareal
so8-bi
tandarecal
ledgeneral
purpose
regi
ster
s.Theyareusedassi
x8-
bitr
egi
ster
sorasthree16-
bitr
egi
sterpai
rs
(2by
te)thati
sBC,DEandHL.
C,EandLarel
owor
derwhi
l
eB,
DandHar
ehi
ghor
der
.HLi
scommonl
yused
andi
scal
ledmemor
y
6.ALU
Thi
sareusedwheneverar
it
hmet i
cprocessi
ngorl
ogical
operat
ionsar
erequir
ed.
Theresul
tsofsuchALUoperat
ionsarenormal
l
yplacedint
heAccumulator
.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
7.Fl
agr
egi
ster(
F)/
Stat
usr
egi
ster
I
tcont
ains5st
atusbi
ts(
orf
lags)usedt
oindi
cat
edi
ff
erentst
atesoft
heALU.
Thesei
ncl
ude;
sign,
par
it
y,auxi
l
iar
ycar
ry,
car
ryandzer
ofl
ags.
i
. Si
gnf
lag(
S)
I
tist
hesett
othecondi
ti
onoft
heMostSi
gni
fi
cantBi
t(
MSB)oft
heaccumul
ator
f
oll
owi
ngt
heexecut
ionofanar
it
hmet
icorl
ogi
cal
inst
ruct
ion.
Thesei
nst
ruct
ionuset
heMSBofdat
ator
epr
esentt
hesi
gnoft
henumber
cont
ainedi
ntheaccumul
ator
.Asetsi
gnf
lag(
S=1)r
epr
esent
sanegat
ive
numberwher
easar
esetsi
gnf
lag (
S=0)meansaposi
ti
venumber
.
i
i. Auxi
li
aryCar
ryf
lag(
AC)
I
tindi
cat
esanov
erf
loworcar
ryoutofbi
t3oft
heaccumul
atori
nthesame
mannera
car
ryf
lagi
ndi
cat
esanov
erf
lowf
rom bi
t7.I
fAC=1,
i
tmeansacar
ryf
rom bi
t3
occur
redwhi
l
eAC=0meansnocar
ryf
rom bi
t3occur
ed.
Thi
sfl
agi
scommonl
y
usedi
n
BCDar
it
hmet
ic.
i
ii
. Par
it
yfl
ag(
P)
I
ttest
sfort
henumberof1bi
tsi
ntheaccumul
ator
.Ift
heaccumul
atorhol
dsan
ev
en
numberof1’
s,i
tissai
dthatev
enpar
it
yexi
stsandt
hef
lagi
ssett
o1(
P=1)
.
Howev
eri
ftheaccumul
atorhol
dsanoddnumberof1’
s(cal
l
edoddpar
it
y)t
he
par
it
yfl
ag
i
sresett
o0(
P=0)
.
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO
i
v. Car
ryf
lag(
C)
I
tissetorr
esetbyar
it
hmet
icoper
ati
ons.Anov
erf
lowf
rom an8-
bitaddi
ti
onwi
l
l
r
esul
tin
t
hecar
ryf
lagbi
tbei
ngsett
o1.
I
nsubt
ract
iont
hecar
ryf
lagact
sasa“
bor
row”f
lag,
indi
cat
ingt
hemi
nuendi
s
l
esst
han
t
hesubt
rahendi
fthef
lagi
sset
.
v
. Zer
ofl
ag(
Z)
I
tisusedt
oindi
cat
ewhet
hert
her
esul
tsoft
hel
astoper
ati
oni
szer
oornot
.
Thezer
ofl
agi
ssett
o1(
Z=1)i
fther
esul
tiszer
oandr
eset(
Z=0)i
fther
esul
tis
non-
zer
o.
Thef
lag/
stat
usr
egi
ster
Eng.
JOHNLUMUKWANACOPYRI
GHTRESTRI
CTEDTOMI
CHUKITTILECTURER@CNCCLUJO