0% found this document useful (0 votes)
18 views21 pages

MP - Unit 2 (Part 2)

Uploaded by

rememberme6783
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views21 pages

MP - Unit 2 (Part 2)

Uploaded by

rememberme6783
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

*

Tntersupts
Tterrupt is a
Signal ot a
psocrss initiated by extesnal
device to nfoTm Hhe processor hat it is ready o Communic
ate he
-

psocess ispUrel asynehronoUs , means it Can


enerated be
ony time oithout
intesrupt vequests Teference to the System clock Thee
ave
elassified into 2 CategoTes
Maskable tnterTUpt here ore 4 maskable
*)
Non-maskable intenrupt one ntesrupts inS8)
non-maskable intevrupts in 2085)
Maskable Intersupt( INT RST55, RST6 5,RST 75) ,

Non Vectored
TNT) Vectoved Interrupt
RST 5.5
65
Non- MMaskable Tntersupt- TRAP
(VectoredIntesruPt)
*) Non- Vectosed
Tntessupt *equire an externol horduore
to
upply Hhe Location fsom cwhere execuHon Has
to be
Testarted
*) Vectoved
întesrupt have Vector AddCss ho
spe ty he
Call locat ion

exp RST 5.5 have Vector


addresS 2cH
cohen RST 55 s nitiatec he
prsoo ssoY cillestort its
prrossing fronm memory locati'on oo2c).
RST (Restavt) Intevsopt- There ave 8 RST insruchons t
8085 Hhese are 1
byte CALL
IÁstruc
tions hat transters He prroqrom execuhon toa specifed loca
ton on enoy (stashng from oo H). he specified loation
sCalled he Vecto address of RST s'na hsuctbon.
Restart insructons vector address -

RST nghsuchon Binay code Hex Code CALL oCATIoN


HEX
D7 De Ds D+ Da Da D, Ds C Calcolatad by 8xn)
RSTO
C 8xO O Ooo H
RST1 o oI CF 8x O O 08 H
RST 2
D 8x2 Oo10 H
RST3
o DF 8x3 O o18 H
RST4
o o E7 8xy= O O20 H
RST5
EF 8x5 O 028H
RSTG
F4
RST +
FF 8*7= o O38 H
111
Hex code
elenotes Hhe
CALL
opcode for
for RST
RST I'nssucbon
I'nsucßon
Location denotes the
Lo
lLocaton
caton of memosy
PTOom exeeurion is hanstevved.
to wh1'ch
to eohieh
Exp det at
any instant of thme the
h e poqrom
PC
Mnemon its
psoqrom
312o(HA) Commert
RST 5
Restst 5
che RST 5 1s
executed he
Fsom 312o(4) to
content of pcwill
Contept pe will
so he
Vector aedress
address of RSTS chonge.
chonge
De content of Pc caheh
ohièh is os28
os28 H
coill
coill be 2028
be
PC a028 H.
H

oo28 H)
oo29 CH) and So on. he
som hnis no program coill start
locotiom. exacobing
Ho he intexd upt prouSS tekes place -
x

det a device intesru ptss


Hhe imie5oproC ssoY USina RST
interrpt. 7:5
because he RST 7.5 ts vectorecd
otessUpt, micToprdOSsOY
Knows 1ó which
,
memost Locahon it has lo ao to get he 1sRCIn
tesrupt
tessupt Se»istce soutoe) address. RST 7 5 had vecor addess
O03cH) So
hat o
microprooss oes to o03c(HJ locabon and in

cation tt coill get a JMP nshruchon his JMP


ns-
uchon will
aive
he acua cddress of SR
*TSRC intessupt sewce Tooboe) is a
IS Stoed in
Hhe memoTy. Every
proaram uh'eh
Code memo interrupt has its ISR stOTecl i

Main progtam 0plo JMP


Ooll OO
oo12 15
oo13
3516 X*_
357 RST 2 8x2=16= 001o(H))

3518

This Content aoill


be stoved 15c0 XX
STACK dusing executn of RST2 ISol XX
1So2 RET
SP 24O0
2400 5%3
35 23FF

18 23FE
Code MemOTY

STACK Memory
Block diogvom for Intesrupt
w System t 8o95
5V Vectov Addves
AL
RST5-

C
Mask
RST:S
D To external
Hard&ore of
o03C CH)

Reset RST 7.55


RST 51
Recognise

J RsST 65
Mask
RST 65
D -0034+ CH)
70038 H

LRST 55 Mask o02c CH)


RST5.5 o028

TRAP o024H)
oo2-0 H
EL S
00 0 H
DI
Reset R o o0OH
Any fnterwph
Recogni'se Tnteopt Engble FlipFlap) Get RST
Code from
Ecernal
N INTR |Hardove

*) RST 45 is Edge sensitive intessupt , So to Btore its Tesponce


DElip-Flop is vsecl
RST 65 and RST55 a r e level sensitive or level triggee
ET stands fos Enable.
interrupt
k DI stonds for disable intertupts.
)Symbol Lrepresants dge tsiggeving andL indicates
arel triggesing
External Herd coove to handle interrpt
RST 2 has a vectoy addre sS = 8 x2 16 = Ooo1 o o o

= o 1 o CH)

opcode of RST2 coill be"= 11 o16 1 1 13


DCH
So cshen device
a
interuptsRSTZ , dvring Hhe executibn MP
Should 9et he code D9 n
ALU his code 1s generatrd b exlei
hard wore.(for eoch ntesrupt Hhere is hardeoave to
opcode
a
generate

INTR
INTR
Intesrupti^g|
device
B025 MPU
TNTA U EN +5

D% -www-
www
www.
w-
ww.
www
www
Do ww

IR 5V
RST2 Code qeneration Harduwave
Code generated by hadore = Dq Ds Ds O4Da Da9 Do
1 o 101 1 1
this s Hhe opcode of RST2 So RST2Jill be executed. he PC
will get he veckor address of RST 2
cohich isS
oolo(H) oites
ececuting RST2 ,Processo% wil) execute fom locat lem oolo CH) .
Machine Control Tnstruetion for Interuptsg-
() Enoble Intemupt-CEI): this a single byte fnstvuchon. which
Sets he Intevtupt enable flip flop
by vsing his nstruction S cwill get 1 tn Inter opt Enoble F.F: so
he devices can
interrupt
C1) Disable Interupt ( DI) - This s a 1 byte instruchon
which
IS Used to disable
Chen Hhe intezrupt prosss
we înset or orite DI tà oUY
of Oi no PTogTam Hhen ahter execuhHor
intervupt
,
t
eoterrained by proces soY. So
devices
interrupts , it is not Seaviced by Bo85. ithe exkemal
U) Set Intesropt MASK C
SIM) his instruction fs osed 3 fon
different functions -
*)Used to Set maok fov
RST7-5, RST 65, RST 5.5
Used to rebet RST
75 flip flop intervopfs.
s e to
Impliment sesial Input |output hrough SiD ond soD.
fovmo fov SIM
fnstruct ion
B7 Bs Bs B4 B B2 Bi Bo

sop sOE x R7s|MsE M75 M6s Mss


Reset Not
f o masking available
RST 5
1 Maski'ng is avoi loble meons
Hhen RsT 75 ntersu pt is masKed
Is gnoned

Maok Set Enade


fo, bits Bo-B2 are ignord
hen Bo-82 can be masked
Senal Out Enab)e it1, Bit B (s transfesrto
Senal output datalatch
*)To mask any ineT
upt , awe hove to f1rst engble Hhe maskng
procesS b MSE =
'1
Then if e wont tornask RST 75 hen
M7 5 1
RST 6S hen m 6:S=I
RST 5-5 Hhen M55 1
When sIM i'nstruction s exe Cuted Hhe 8bit dato of qceumulatoY iS
ronsferYed to
8 bits of SIM CBo-B#). so
have to place h we
8 bits 1 qccu mulator as
pen own Aqui'rement eefore gvna o
executhga SIM tnsthuctb.
exp write instruetionm to engble RST 5
logic o on sop pin . 5,RST 65 nd tsanefe
Ans to Enabe
RST. 5.5 and 6-5 we fivst place MSE= 1
M6'5O
M5 5 =o J so Hhat they are avoilable to inteupt
we hove to take
logce o fom soD pinSo soD
SOD (B4)-- O
O (B4)
and sOE CB6) 1
RST 7-5 s not
1equired so mask if by pbcna M7S*
and RST 7 S 1

SoD SOE X RT5 MSE M7m6sMss


O 1 1 1 1 O 5C OY

code e
put X =O
Code we Put X= 11
MVI A,5c CH)D
SIM
EI
HLT

Sexial output of data hroogh SoD -

8o85
* Nhe SiM sr.
s erecuted S2
ill be closed
SIM
s1
sOD Pin" * t soE = 1 Hhen S1
coil be clo sed
datg on
ond L
(8)soD
of Acc. will Cend to
sop SOE sOD pin

Accumulatov
4 Read Iterrupt MadK instruchion ( RIM)- Tnis înstuchèn is osed to
Tead the &tatus of vaniou
pending intesrupts and also used to recieve data Sevialls onsID p

foTmat ot RIM i'nstructhion


B B5 B4 B3 2 Bo

SID
17516s|I55| TE M75 M6:s MSs
i t 1 Hhen it tells
itany of one bit is Hhat RST 55 is
MasKed
1Hhen it shotos het
the particulan intevY i t ? means RST6:Sismask
upt is pendingt'e
LH i means RST 7S iS maoked.
oterropt is not Seawice Hhen Tntrrrupt Enable lip Flopi
Set
et.

bit
> Sestalinput data C Datare uered on siD pin ot 885 ill be
plad on his pomtom).

8o85
RIM
data bit on SID
Suitch (itcsillbecloged Pin of 809S
when RIM 's ¬xecud

sD B4 BaeB Bo
ACC
87

Eap t agter execuction o RIM fnstsuchion Aceumulatur had AGc).


tohat informacbo n uwe cuill
get fosn .
Sol
B RSTSsisenable
RST 6.5 is maDke
RST 65 s
RST7:s amasked
L IE0 means all
pandint which are masked
he
intesruptsS
are disabled
RST S.S is nst
RST 7S not
pending
pendina
Bnary bit 1 1rectered fom 610 pin
8085 Machine Cycle and Timing Diagam
X

BoB5 has 7 different type of mochine cyecles


) Opcode fetch iv) Ilo Head vi) Bus Tdle
1) MemoTy Yea V) zlo write
D Memory uDTIte vi) Interupt Acknouoledge
1) Opcode Fetch Cycle -: let 64H opcode is placed at Code Memory
location 2080H 8085 has to
tetch his opeode fsom memeTy. this opeation
ll get ezecuted 4-T states cohich are ezplained 64H 30
as

T1 stote K) PC will place Hhe qddress on


qddresS bUD Ag-AIS = 30H qnd Ao-A7 20H
)ALE = 1 , by S0855 MoKe Io|M= O So Hhat
)
memoTy 2ets activa ted.

Opcode Fetch
T1 T2 T3 T4
CLK

Ag-Ai5 X30H
Decodin9
AD-AD X20H 64H
ALE

TolM TolM=o
RO
Ro-0

T2 State - *) Make ALE =0 (Deachivate)


*) put RD O to enable Hhe required locaion 3020 H ond
place he data 64H on dat bus.

ae< Bos5 places He content of dats buo(6 uH) into IR


Tegiste
x)Deactivate Rb 6gna to disable memory location

T4 sate *)AP decod es he op code using Tnshuchon decode


necessary signals ane sent by conol unit
*)One byte Instoucthions like Mov AB ANA ,ADD R
INC Reg are executed 1 T4 ctate .
Memoy Read Machine Ctcle
Code Mem.
MVI C, 45H

*)First 4T 5tates will be of opCode Fetch, whicb


OA H 36 0DH
4SH 3601H
IS also called Mochine Cycle i
)Ate 4hT state he decode sill 1oform
Control unit Hhat immediat byte has to be moved
Trom Code memoTy to Rogisle c

Opcode Fetch Memory Reacl-


T T 16 T7
TI T2
CLK

Ag-AIs X 36 H 36H

AP-ADX00H OAH o1H 45H


ALE

Iol M 1o/M-O 1o/M=O


RD

Iol Mo to select operahon fom momort


T5- During TS ALE 1
3601 address will be
ADo-AD, >Ao-A7
Ag-A1sS floated on he Qddrss bos.
at he end of TS ALE =O ( disabled) and multiplexed bus (AD-AR)

ill get trisl l d High Impedance Z).


T During Ts RD 0 to get dats out fsom memet.
T Data (45H) wil get stored 1 gisl c.
at Hhe end of T RD 1
To/M 1
MemorY Wite Machine Cycie let HL 8 6 0 1
Code Mem
A-4SHH
MVI M, A 32H 3600

K X 360ol

*First Machine CHcle ( 4T) ill be of optode fetch:


*ATes opcode fch , conhrol unit get the to formatio
that tmmediate datg byte 45H hasto be stored det
whose address will be
1 Memory
provi de by HL pair
4SH 8601
45
Opcode Fetch Memory Nrite
T1 T2 T3 T T T6
CLK

Ag-As 36 H Reg H 86 H

L:0H
ADo Xo0 H 32H (opcode)) O1H Ay5H|Cdata)
ADT Decode
ALE

Io M Io/M=-0 1o/M=0.
RD

WR

*Ts Address of dats Memot oill be pævmdas by HL poiv


H 86 Ag~AIS
L0 Ap-A ALE=1 , 10|m = O
)Ts-e Dae 4SH wi) be plg Cod on datg bus RD = 1 WR =O
*) NR = o oill achivat memory locah'en 360.
dat cill get writen on locahn 86olH.
)T8
Addressing Modes o 808S
The way of specîfying data that has to be ope^ated by an instuc-
tion is koown as gddre ssing mcede.
Tn 8085 , here are 5 types of addre ssing moddes
1) Tmmediate Addressing mode
2) Registe Addre ss ing mode
3) Direct addressig mode
4)Registes Tndirect addre sing mede
5) Tmplied Tmplicit addressing moele

Teeiare AddresSing Mede Sourte operonc is aluoys data.


*) dota con be eithen of i byte o7 2 byte .

Exp MVI C, 45H Smove dotq 45H nto YegistenC


LxI H, 210OH move data 21cOH into HL pair
TMP 180OH4 Jump to address 1goo H

Registe Addre ssing Mocde- *) source and destinotion operand should


beregiste.
Exp MOV A, B move Hhe data of registes B into re. A
ADD yego B wi he Cootent
8 Add Hhe Content of
ofreg A and place he esult in reg. A

Direct Addressing Mode-*)In Hhis mode address of Hhe data dill


be specify sihin the istuchon
l6oH
Exp LDA 160OH lcad he Content of memoTy locaton
into occumulator

Hhe data of address 35H into Acc


IN 35H Copy

In his addre ssing mode , data s


Indirect Addvessing Mode-
available Insíde he
memoTy and h e addr.

Specified by a registepir C HL, BC oT DE).


of he memory coill be
of memoTy locaHion
Mov 6, M move Hhe dotq
Exp
pointed by H-paiv Into reg. B.
location
LDAX 3 move Hhe dato of memoty
poin ted by BC reg paiY 10to acCumulalar.
Implied Implicit Addressing Mede-i No operond specif'ed tö He
inshsuction
I n most of he inssuchon, default operand is Accumulator
accumuaov
Exp CMA Compi ment bitsof
RRC Rotate qcumulator bjts Tlght by one
positioy
INSTRUCTLONS OF 8o85
Instruction s a
binavy pottesn desined by Hhe
he manufoetore of
paticular mieroprou ssov to
pesforma speeifie taok Bo85
has F4 nstsuchons Colled nstruchion set
, he ohole
set of 8o05 miesopsocessor Con be divided nstruc hon
toto 3
general,
Sections
) Infosmation movement Instsucton-
C Data movement) hese tnstruchons
ase fusther divited
into 2 Toups
o) Groupo
b) Group 1

InfoTmatio moititat ion Inshsuchon (Group


Control Instruchion s (voup Group 2)
2)
3)
Infovmation move ment
Instructiom S
oup O
- Instruchions t Hhis allows Hhe
group follousin
peration
a) Immediate Data move met
b)Inerement] decrement ot
c)Loading seg'ste
d)
stosing. of Tegi'sters
Shifting and Complimenting of Contents
of accumulato
Group 1 -% This is the
lorgest
w 9soup ot tnstruetion and
fs Called MOV gToup hese qre Used
to move
he nfosmation fsom
he
SoUce to destination
BoUTCe and
destination may
Ilo devices and
memoTy
be
T*qiste
Byte brgahi sation for aroup O- Byte Oraanisalion tetls
usheF houo Hhe 1shsuch'on
byls are toxmed. what s
Ishruchon. The
he81mifjcance of each bit t the
Byte Ovanisahon is also Crillerd or knon ag3
devatjon op-Code
- - o o 0 o
I
o -
O o o -o
m

D. 3 I mo o S

A
0
qs MovI s Gro up ó istsuchon so Ond will be
D7 Dc Oo
Register B d'cates Ds De Pae 000
as Hhe immidiate
So we
operation ís parfprmed o9 shgle *gister
hove oa D Do
So
130
op- cods wil1 beeome
D, De Ds P4 D3 DaD Do
6H
O6H ndu'cades he op- code for 1istsuchon MVI G, 91H
Exp INX B3
as
as
TncTemant register paiv B-c
Incre ment
belongs to gvoop 8 so Ce have D De = 00
B-c egister pair codo= oo
1erement opeation i's to be
pertosmeel on
regisien pai
B o11
D Dc Ds P4 P3 D2 D Do
o O1 1 O3 H

T is added by defaut
Reg'ster pair Codo

f coe hove LNX H Hhen

10 C. O 11 23H
defoutt addihion of o dusingNX
* Default valu may be O or 1 Some tnshruchems it s
and i some it i's 1' Hhese valves avre cho sen bp defeut
Tnstruchons of Goup d-
MVI moveimmid iate LDA Lcad RLC 1Rotation of
LxI Load immidiate STA Stove
RRC Accumulatoy
INR Inesement DAD add Re airto HL. datg
DAA
RAL
INX finCYemert Reg Raiv
DCR deee ment CMA Complimat A RARJ
STC set cavY
DCX decrement Rog.Poi
CMe
LDAX Compliment Cavry
.Load from RaPoi NoP mo
operahon
STAX Stove som Rea.Paiv RIM
LHLD Load from Reeieve or Send Seviál data through
HLpai SIM SID and soD pió
Byte Ovgonisation of Goup 1 Insruchons -2 This 1roup
roup 13
13 the
he
azest aroup ohich
moves 1itormaton from one souTce to oHhe SouTce or destinabion.
this is also
Toup called MOv qroup.
D Ds Ds Dy 3 D2 Da Do

R2 R1 Ro S2 L S So

code fovN Sending Rzistes


Recievin
Group1 Registe
R2 RRo and S2s So ave Hhe Yecieving ad
Sendiog TegisteYs.
Ra Ra Ro
(s2S1 So) Regi'ste Register Paiv Code
o o o
B B-C
C DE 01
o1o D HL 1 O
11
1 O
E sp 11
H
1 O1 L
11 o
M (memory)
11
A
P CAccumu latov)

Exp MOV B,C


Hhis nstruchior moves the binory data tsom registea c +
Reg'sdea8.

41 H

Group 1 Code fo
Code fov
Sending Roale c
Reeiering Register '8'
Exp MOV M, D

+2 H
Group 1 Codefov Code for D
M
12
6yte Organisatio fov Group'2 Instruetions - This group is called
arithmetic and
logical 3roup comparilon of 2
registerc avve also one by
his qroup intsuchons

D Ds D Dy D3 Da D Do
1 o Aa AAo
S2| S So
Code fov ALU operaton
roup 2
Reiste tofornation

S2 S1 So are Hhe
registers hich ere source of data .
he
Code foY ifferet Taisiers are same as
1 qroup 1
Aa A Ao
ADDITI ON CADD)
O 1 Add coih camy
CADc)
Subshachon
CSUB)
Subsrachon cih borow ( SBB)
o8ta AND
Exclosive -
OR CxOR)
Logtad OR
1 1
Compone
Exp> ADD B

4oo ooololol 80 H

Code for Code fov


addition Register B
Io Hhis
instruchon souTce 1s defined asB but setond
not
is not depned. when 2 opeond
ope
Operand will be Accumulatorrand
a not
aefned , Hhe defoult
Hhis (A)
1stTuction oill
Exp perfotm(AtB).
CMP H

O1 oo BC H
code tor
Codeos
Compore eisr H
o 0 0 o 3
o o
O
O

3 HH .

5 (
Exp TNZ Address -e. JNZ 2000 H
he instruction says ump t rot zevo to oddress 2000H.

1 o olo|oLo] = c2 H

conduho naumnp
Conditon 1s
tnot Zero
Exp CALL 2440 H

1 o 4 o1 co H

Uncondubonal
CALL

*)In roup 3 nstsuctons , Some are designed by he tmanu-


factures qnd here: is no Concept behind Code foSmation
AIHhough
AlHhouh hey are fosmed using 80me logic but as fas as
lerel of
his coUTse s Concerne Hhrs do es not maHe
alot at all for Some nssuehons
InstructIdn Fotmat 15
--X-

Ay lnstruetion or data wovd s used to


Convey infov mati'on
ot operation to be
perform ed ( Known as op-Code) n d h e -
address of memo
sY locetions oT rgisters Containing he data (
Known as
ope rond )on ohich operatibn is to be
perfo1 med.
'nstruction

op Code operand
here are 3ty pes ot tnstru chons cwe Use o micopsoco SsoY-
) One
byte iistruebon - In
histype ot nstsuchon inpimaa-
tioo about Hhe
is contained i a
ope rabon and locabon
Single byte.
MOV A, C
1n'struetion haa code 79H.
noco
9H s an8bit
(one byte)
nation abut operabon C mov) andformat ohich have
ation iioY-
locabon C C to A
(11) To byte Register).
iistruction- he two byte instrucho n have
nstruchio n have
2
field3 -a) ap code field
b) Data |Address field
Exp MVI A, 50H
Hhe above
iistTuchon have2 opcode 3E H hich tells
US hat mmidiate data has o be movtd
A h e instruchon also R to regI'steL
so he specities he data 50H
nstsuchon has 2 bytes 3EH, and
(ii) Three byte 1istruetion - 50H)
opcode dafa

see byte nsruction also have 2


trelds- a) opcodu freld C by te) ond
b) Data Address) field
Exp CALL 2000H
Hhs hstruchon hab opcod! c2 H cohich speides he CALL
OpaTation rest two byis are used by address held
byte a = 20 H
byte 3= 00 H
2056 H STA 2oSo H
xp LXT, ete.
6

he Complere fo mat of hstuchon durng pTogramming s


( Label Operatron perand C Command)

Hhe frelds bracketp are optiona l e hey Can be ose


or can not be used dependa upoy uses
Each field Seperated by a spacs
cwih other field.
Commandb a r e Hhe field ahich Use Oses to
Specity e
operaf io execuad by hshuchon. a semi-colm must be
Used Fo spe c f* Command
Label - he Label
w gtves a
speitic name to ao nshucba
and Hhis nomne Can become he operdd for otHer
rnstrucHons.
Exp LOcation abel OPCode OPer@ndd
10 LXI H, FC22(H)
20 MVI C, 0s()
30 LOOP MOV M,A
INX H
50
DCR C

( his progra LOOP Label is osed ttoe cant to

execute he 3 1stsuchns belouo MVI hen e


ConJust
Call Hhe label e
CALL LoOP
by his hstruchon
byhis he proqrom automob cally stovt execu'-

tin
ting fom suehn MOV MA and so
on
Rules tor label-
) Label must be t o 6 charaeter long
*)9t contains letfers from A to z and di'aits from O fo 9.
) No speciol choracters con be used.
muot oith a ete
be start
Registers CA, 3,c, O, etc) and operabon codLs ( ADD
Mov etc) Can bot be vsed as lasel
k)One Space & lelt betoeen Hhe 1abel and op code

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy