You are on page 1of 3

Lab2:Ar

it
hmet
icandLogi
coper
ati
onsi
n8085
_
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
_
Name:s.manideep Rol
lNumber
:AM.EN.U4CSE17163

_
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
___
__
1.Fi
l
lthet
abl
eforeachoft
heassembl
ypr
ogr
amsbysel
ect
ingsui
tabl
einst
ruct
ions
f
rom 8085I
nst
ruct
ionSet
.
a)Loadt
henumber30Hi
nregi
sterVand39Hi
nregi
sterC.subt
ract39Hf
rom 30
Husi
ngSUBmnemoni
cs.Di
spl
ayt
heansweratPor
t3.
Whati
sthet
wo’
scompl
ementof39H?A7
Whati
sther
esul
tofaddi
ng30Ht
o2’
scompl
ementof39H?D7
Whati
sthe2’
scompl
ementof09H?F7
b) Load8-
bitnumbert
other
egi
ster
sB,
C,D,
E,H,
L.Addt
hose6number
sfr
om 6
r
egi
ster
sB,
C,D,
E,H,
L.Di
spl
ayt
heout
putatPor
t4.
c)Loadan8-
bitv
aluet
oPor
t0usi
ngI
N 00H.UseANIopcodet
oANDt
wo8-
bit
v
alues.
d)Loadan8-
bitv
aluet
oPor
t0usi
ngI
N 01H.UseORIopcodet
oANDt
wo8-
bit
v
alues
e)UseORAopcode
Assembl
y I
nst
ruct
ion Memor
yObj
ectCodei
nHexFl
agsorRegi
sterFl
ags
changedet
ail
s
si
ze Addr
ess
(bytes)

a) MVI B,30H 4200 06 30


MVI C,39H 2 4202 0E 39
MOV A,B 1 4204 78
SUB C 1 4205 91
OUT 3 2 4206
hlt 1 4208 76

2.Showt
heout
puti
n8085si
mul
atorf
ort
hef
oll
owi
ngpr
ogr
ams

a)MVIB, 06
//
LoadRegi sterBwi t
ht heHexvalue06 In the Memory 8200H value is
MOVA, B 13
//
Mov et hevalueinBt otheAccumulatororregisterA
MVIC, 07
//
Loadt heRegi st
erCwi ththesecondnumber07
ADDC
//
Addt hecont entoftheAccumul at
ortotheRegi sterC
STA8200
//
Stor
et heout putatamemor yl
ocatione.g.8200
HLT
15CSE285:
EmbeddedSy
stemsLab
/
/St
opt
hepr
ogr
am execut
ion

b)LDA8500
//
Loadt heaccumul atorwi t
htheaddressofmemor yviz8500 In memory 8503 the value is 0
MOVB, A
Mov etheaccumul atorvaluetotheregist
erB
LDA8501
//
Loadt heaccumul atorwi t
htheaddressofmemor yviz8501
ADDB
//
Addt hecontentoft heAccumul atort
ot heRegisterB
STA8502
//
Storet heoutputatamemor ylocati
one. g.8502
MVIA, 00
//
cleartheaccumul atorwith00
ADCA
//
Addwi thcar
rythecont entoftheaccumul ator
STA8503
//
Storet heoutputatamemor ylocati
one. g.8503
HLT
//
Stopt heprogram execut i
on

3. Wri
teanALP(assemblyl
anguageprogram)forthefoll
owingusing8085simulat
orforshowing
t
heresul
ts
o Addf i
venumbersandst or
eiti
nt heconsecutivel
ocat i
onsint
hememor ystart
ing
f
rom 8200
o Wr i
tedownt hei
nst
ructi
onsforconditi
onaljump,incrementanddecr
ementuset hem
t
owr i
teadelayl
oop(use8085instr
ucti
onsetpr ovidedintheAUMS,don’tseekhel
p
f
rom other
s)
MVI B,01H
MVI C,02H
MVI D,03H ADD D
MVI E,04H STA 8202
MVI H,05H ADD E
ADD B STA 8203
STA 8200 ADD H
ADD C STA 8204
STA 8201 HLT
ASSEMBLY SIZE MEMO OBJECT CODE (HEX)
(bytes) RY
Q1a) MVI B,01H 4200 06 01
2 4202 0E 02
MVI C,02H 2
MVI D,03H 4204 16 03
2 4206 1E 04
MVI E,04H 2
MVI H,05H 4208 26 05
2 420A 2E 06
MVI L,06H 2
MOV A,B 420C 78
1 420D 81
ADD C 1
ADD D 420E 82
1 420F 83
ADD E 1
ADD H 4210 84
1 4211 85
ADD L 1
OUT 4 4212 D3 04
2 4214 76
HLT 1
b) IN 00H 2 4200 DB 00
ANI 0FEH 2 4202 E6 FE
OUT 2 2 4206 D3 02
hlt 1 4208 76

c) N 00H 2 4200 DB 00
ORI 0FEH 2 4202 E6 FE
OUT 5 2 4206 D3 05
hlt 1 4208 76

Page2of2
15CSE285:
EmbeddedSy
stemsLab

Nameandsi
gnat
ureoft
hest
affi
nchar
ge

Page3of3

You might also like