Вы находитесь на странице: 1из 4

EXPERI

MENTNO.
2(B)

Ai
m:Towr i
teanass
embl
yla
ngua
gec
odet
odi
videt
wo8–bi
tnumbe
rsbyus
ing8085
mi
cropr
oce
ssorki
t.

I
nst
rume
ntsr
equi
red:

8085mi
cropr
oce
ssorki
t

Al
gor
ithm:

S
tep1:
Sta
rt

S
tep2:
Loa
dre
gis
terAwi
th8bi
tda
ta

S
tep3:
Loa
dre
gis
terBwi
th8bi
tda
ta

S
tep4:
Loa
dre
gis
terCwi
th00H

S
tep5:
Compa
reAwi
thB

S
tep6:
IfB>At
henS
ubt
rac
tBf
romAa
ndi
ncr
eme
ntC,
jumpi
fnoc
arr
ytos
tep5

e
lses
tor
ether
ema
inde
r(A)a
ndQuot
ient
(C)i
nme
mor
y.

S
tep9:
Stop

1
Fl
owc
har
t:

St
art

Loadt
heDi
vi
dendi
n

Loadt
heDi
vi
sori
nRegi
sterB

I
nit
ial
i
zer
egi
sterC(
Quot
ient
)

Compar
etheno.i
nBr
egi
sterwi
tht
heno.i
nAccumul
ator

YES
Is
B>A?

NO

St
orethecontentsof
Accumul
ator
(Remainder)atsomememor
y I
ncr
ementRegi
sterC
address

Movethecontent
sofregist
erC(Quot
ient
)To Subt
ractt
heno.i
nBfrom t
heno.i
n
Accumulat
orandloaditatsomeaddress Accumul
ator

St
op

2
Pr
ogr
am:

Memory
Mne
moni
cs He
xCode
s Re
mar
ks
Addr
ess

2000 LDA2050H 3A Loa


dDi
vis
ori
nAc
cumul
ator

50

20

2001 MOVB,
A 47 CopyDi
vis
ort
oRe
gis
terB

2002 LDA2051H 3A Loa


dDi
vide
ndi
nAc
cumul
ator

2003 50

2004 20

2005 MVIC,
00H 0E I
nit
ial
izer
egi
ste
rCf
orQuot
ient

2006 00

Compa
retheno.
inBwitht
heno.
2007 CMPB B8
i
nAccumul
ator

2008 J
C2010H DA J
umpi
fB>At
oaddr
ess2010

2009 10

200A 20

200B I
NRC 0C I
ncr
eme
ntRe
gis
terC(
Quot
ient
)

200C S
UBB 90 S
ubt
rac
tBf
romA

Re
peatt
heabovestepst
il
lA
200D J
MP2007H C3
bec
ome ss
ma l
lert
hanB

200E 07

200F 20

S
tor
etherema
inde
ratme
mor
y
2010 S
TA2052H 32
a
ddres
s2052

2011 50

3
2012 20

Movet
hecont
entsofCt
o
2013 MOVA,
C 79
Acc
umulat
or

S
tor
etheQuoti
entatme
mor
y
2014 S
TA2053H 32
addr
ess2053

2015 53

2016 20

2017 HLT 76 HLT

Re
sul
t:

Me
mor
yLoc
ati
ons
-

Be
for
eex
ecut
ion Af
tere
xec
uti
on

2050H 02H 2052H(


Rema
inde
r) 00H

2051H 08H 2053H(


Quot
ient
) 04H

Re
gis
ter Va
lue

A 08H

B 02H

C 00H

Fl
agRe
gis
terCont
ent
:

S Z - AC - P - CY

0 0 0 1 0

Conc
lus
ion:

Di
vis
ionoftwo8bitsnumbe
rsbyr
epe
ate
dsubt
rac
tionha
sbe
enpe
rfor
medus
ing8085
mi
croproc
essorki
t.

Вам также может понравиться