0 ratings 0% found this document useful (0 votes) 60 views 35 pages MPA Module 1 and 2
The document discusses microprocessors, specifically focusing on their architecture, data and address buses, memory management, and instruction execution. It outlines the characteristics of the 8086 microprocessor, including its registers, interrupt handling, and addressing modes. Additionally, it touches on the execution unit and bus interface unit functionalities, as well as various types of addressing methods used in programming.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save MPA Module 1 and 2 For Later es Micro procacsraxs. oe —Apyl linens arr aeeitad
ome [7 /' 25
DigitaL fo Analog CONVENT TOY
DAT ae 43 ~
Feet foe |
“ee
fab +
aoe bo
digh bal Convertor
Example fia micro procyessoy sy shen :
| $204 —> First microprocessor
SOBs
FoRS
Boxee ]
Pentiam
M Intel |
Be Proc enap i tke Axith i ogicaL
le Bs Taree) na ee
Jowing :-
fiom ( Data)
(aaa Address )
ee. signal -
ddreos, ——— —=
if iC a ;
sd | | fey mem or"
ct
=
Bi no’ 1¥td —> BUS ,4
(pom
Address busts wnidirert inne L
Dake bus is bidwechonal
Centro) bus ae mang nob be bidive diol
aes St eoe6.. inane
Size ot dota bus is 16 bibs witelegie gh
64 bits wit,
3026 is also Known 0 l6-bib microprocesigr
Size of addres bus ts 20 bits. . ,
tel \\ TAL
A nibble —» & bibs
2. eek biles
A werd 3. 6 bibs Ldspende om rnicwa procter)
i
T
Memory we. ic aoe of rayin
Utes boasts aOMc(oc ea ee ea cnn net "
H Sleck Frequency is_gentraked- wing ta shat anil
7, ~
© S04 mentoring Divioles memory inbw seeltgeeupe.
This 1's dowe fey memory 2eulh
y maragentt ch on
Lin fou} 4p ed of procedsoy A
mt WD lodé segment- Ay
_@® Data Pome
© Stack <2 ee
lo _= sSgment™
© _ Genevad purpoie. resisters “=> Le biks® size
E Ly J can oliy user os t bibs
Used for Pera shee Fas heles its increasing
strives memory twiexternal
! Speed ~ Rothery Han
- s directs ain reat ter
Four Fypes oF rae :
O_ Ax ~Ace shal Ta ef Pra
@ 6x = Bae en Be v L ;
= Counter eH cL Highey Lower
= Paton PH mn Bye Byte
assehive : ;
1234 56754»\
Ab
Hy
UH
LE
i
Two index
ST - Sowrc¢ Ende
DI ~ Dokuahim tndex > 16 bit
[owt like scanPO. funeton in Cf
hers.
S16 bibs!
uscd a poker, points memory locatims ond word
| chile — tans inalmacbimas.
Contents of address bie
of feet address
gare acdd-rtos
Size st ome segement is 64K8 max -
3000
05 aoiiperes
d
Ds
GS:
LJ
Size cf reqishey
Isfi sc oAenboct-§ aciteamnlis souks
rh
Micro process @interts an extra Lexe in C6
‘ coo] Sasi
ooo}
mono Oo |
st CExample)
= Addvens .
in Lb $8
Piihe~ fee roa 2 number ec
za
Ioeatton
a0) we neck ty stoved twit ree
T= 0% in reasbiy -o
w- 03
D3 - Oy
DSR 3Sr
ES Rs pTmee rare reaisen Saas :
a oe ee eee
© gp— Bane Pointer
L@ sp —> stack? pened | -
A Size of all pombe s ore lé-bits.
| cse: zp } } .
code Segemendt- reg) shee aloof goes Nite Ep Pe
| g <
| addres (20 ibd ‘
i Mev AL je3suy
eee operand -
operabiow roe on whidh operation it performed.
code *
= wang machine code (8 bI/ 1 bybe) we com Bele
ee size a byte Sonn opcode. ae
fee opewand ECGs
size
‘Max size @ Enabling is ae ee
roi) MOV AS A3H-
9 0 03 Mov BL, 524
ce two byker neq uived = AE in gtachon Ree
Next iste jeune Starts at 00003
©0600) Mov AL 234
9003 mover ,57H
o000F App AL gL
oon0G INT
Pe
touch Dinter « foiky THe mevnny tecabon 1
ate ae jtrc tion by be is to my read / fetchBh
ees
ea im 8086 (Instruction Reg ister)
Size 1s. 6bytes
oat Works son pees In Fetes owl- principle -C -(F reo)
Two wits ‘ a
“| Brv s+ Bus Interface Uni > (fale dota)
Bee NEUE EwecwRbw wit :
| 2 70 perform ope-whin ;
mall t '
ol Instuction @Quewe tre part gf Bru
Pipe lwing ¢
Ye eee
Fete Emcee ues stage).
| Ja => peli Sl
To oa ;
ok: Eo i 2
ten Fy fs execubed Sim Itaneowaly Ty ts
feted -
Exewke (3 stage )4. A_machine maimtane be vatyre Con ee |
LO mala t Ord We Wank machine toi
| buyn 6 once veached oa parts cola hemp evakuve
| tars is called Subsouling
| (Adding o function Iw main
progam) S a
| To rebyrn bacle tou main pro, Ta Poemnoey
| OL main px: Mths TP pushed i tae
stack ond once | Swhroutine execution stops forctum) |
te TP is poped onk= beaker) to malin peg am.
(|| Tieevvupe j
Two types of inkervup B ‘ i
(onsen ee inkevrup te 2256 interrupts (0 to 155)
® Hardware inner i= Two pins NM and ENTR
al al
In software there ore #5 Aedicoted intern
pts
Me Oley NT, 0.3 k ak % :
o
when main PO9-vam ts runny and we enable intew-
i se Poegrcum wilt Gc a) Ts RC Trterrwpt service
we) ond Men goes to I RET (Gees) FN
92s to mal poesia :
Main p0q-ran i
o | v D FZ Tse
v : .
erable tab erath I
—+ 7 4
Ip s Thea i
Push
ai
STACK for2
we | a
| More 2 tyres of. ee ks
O Veckoved i= Tf ty, Bela t oddvens a. od
: gwen then ib js known os ve chrred_ inher
Now-vectored i- Address (¢ nok: given SE thse
tent. __
_ _~ oY
Mot 2 types of inbery
OO Moarteable *- Enable or disable eas wing a bit -
I@_New-mue ables Can nok Enable er disable tig bite
TNTR ig markable - (
NMI ys hon-mosleable -
M16 wit ALU is avallable in 8086: T+ is wed fer
mal bipro cating
Master-Slave. relation -
_ of. circle \- 8086 main peorenae
8°97 Co- processor
am sian corey
ero, overFloOl
PAGE No
(es,
—
Arechetencc
Aw chiteckives oF 80
Crnemery meine) j
aes on ia
ly A
(Bus ThtevPace ee
| wa ; =) i J
BrCl chy,
j 5 = [eres
cse a
ESE Bi
STs 2
DSR
= q1
A
Reefs BOO Arie ctuve je dlidenl Iie & pact
7 | Bus trterface unit
—— |@ ExewHon wut
Bee dividing The Worle between Hose two units speed
ti
a | BIV performs the follwing fuss chimes
MM ee enol a ad dt
— |b Lt reads gan or fetchex instuctom byte from
oe t
= |
ID Read “tre dake Lema init 4 oskp ut Aevie
ss }
ln
[Bo OOo a pole duvices ard memory
Execution Unack = Po lowing Punches
OTe tel 1 repeat ae pe eee
on late Loe /
@Q r+ Reon pie ingtnu chon by bee ond pertgrm sees
eee
zl [ace] x [re [x [cr]
AUX: Nor
F covery i Comal Flaga
9 ne
Carry flag'- If vest generar cory af ber ae
d :
CF=4 | ow ehe Fed
e-4 ES Hy
. 2a
‘ AcF=0
| ROnOn a
‘i 0 0)0 >
oe
eer | MECUMON GS ar She SO)
Forty flags= Tt Hee number 66 owe 4S iw the result
is oll, Toe =I ee Gif odd PE=O
Avxillomn Corry I= IF cory js generoted trom lower
nibble ov heud! Praw feered fom D3 tp De bit
Uae notary AGS | |
Lain aor!
tate Ooo |
Bit lo )
Hess Tt oft operosb inn SOOM A 2 oro
24 ov che 2F 0
mre eae ee 0 flog at che
7 4 a
Cony
|
- ud | OAS ia
H Oo 1 rn
SP aires mina
(Fao
aeons |
Were
ee =O Es
St. ae2 oa
¢
vat: ¢
Itlt sat |
C000 wo uy
2009 00g
Find the Rete rei| Li,
followin, optrokion
ee
16-bit” value ot flag ~edister. ae
Jind :
eel at — WAN fooy
san 9010 1010 dics
OD oo01d, 0011
Dis Died Me Diy Dio Dy 'Ds D, Des Ds Dy Dy “Pr Dy Do
Lo 2 0 VAD o 0 tt © 0°. 50 vai
Oo
= eS
es Oo Ve I
Lag cregisher = 001 Haan
Sy
OTo speed Yup the operation of program exe
cake.
hea BL time from pacman
1© Tr Bru canbe fete imsbructionn by bes
| the Ev jis di cod tes ae
Te BIv feteher 2 mony on 6 byten F an instructs,
oy she sli th
Foye “wile ug i cle dole reqwire vse OF sy shen laws
=H) Oweur je _conbnwowsly Ds Neo Pie wey
fem Shove se new age. p
|| Seqment-s
PortiHon of memory *
bus ts fied bt in Veabl f, Tra TMP sinstle
Pte auene must be flushed okey dina reloaded
IMB => 64 kB 2/16 segmodte
0 This
IME memory Can be shecemed in {6 Segments
@ ‘cs
Ds = aT wel fay dean Porpeses ~
‘ND —! i
a P= an i 40 Vo“
ADDIS
(Niwas
sa
A
\
a
>
or okt om if will be dato -
wrdors tod if Ap rites wil =
+ Therefoyve Ve war pi
will ge mAD pwRET cle PAGE No.
Made DATE
ALE:- Address Latch enable ¢
Sy Se Tino catiove
9 2 ox Alternate doko . aan
j Cee A sl Stack =
i rz Ss Code a |
{ 1: Dodo a
| 253 Erk exw flag bit
Als R dow
: BHE /s7
a Bus high enoble - ae
Dis
Op erably
118 bik akan: fimov ax ;fo400) 4
T bit in wdc Mov Ar [0401]
° ; 8 bik in dake Mov pr’ Coyoo)
| No acce
eea [7 , +
Hod Pro saamnina io dole ——
The way in whic pros
penne speci She Seca
ix Be iactnaction fs knonom 2 aden —mst $=
Emmediate addrerst mode ;
| Emmediately pues foe In Enstrucho~
eee Mov PH Res
cd
Hy
Register odd ressing moos
Tn instnaction Ee ter 1s specified and in —_
rtaie bee Pre Aoke js presint _
Tru cline Regi shew |
eae a ee |
bE. =
t
tq. Mov AL, BL
Mov Ax BY
Fo oddyeasing m
Pnstruchion “the memory,
CEM availa)
Jotation is gies directly
In Memory he
Enstruction 1
Memon | ee
lo tation 7 ay -—
i
Co4vooy)
a\\\ie
1
\\\o\\\\
fet
| Rejishew indlivect> addressing moos
memory lo
| we give na coe ond in vege bec
co 5 Specified. hyo! wf we ACC
| doko
Beq Mov Bx, O4o014
7d
Mov Av, [ex]
Index ed —
We specify index J venistey in whrcl
; J
| thwa! hide we acces He data
eq. Mov st, ono0o
memory Loe alten
Moy AL, Cst]
Relea Relative Addrewing mod
Eble Mine Adds, (EA) and the’
o ‘ cif Fenster ond displaomanl- jn_inabuction from.
TRA sber we gee rom om Joctbon , hence qu a
Pred we “access
nso tic
ae Die placomat} 4
cA
Remon,
a
Dares Els Ta
erie
Location, CGD BS soon en eeeN ONoUN
d
ps Tnstbuctiow
i [ Base aul a
os tebe Me [a eect eve I)
4 | vege he wey is be Oc od ye oe
i ae oo
i |_| 4
T
! ae
3 eq. Mov Ab £ Bx + sz)
Jv
i ®|| Relative bare indexed ee mode
f : Bose pelea disp) a tment
Reaish ; aa
a eq shee Reais hey
= vy ay Kea
Memory TD Dake
{ Voc akon
= [Memory Teuton -———
eg Mov parC BX+sT +04]
TS
MOV destnation, source
Mov Ar 254 PALE 26H
mye cx. FFFE We Ox =
CHR)
poe C le) AL= FE
an 9 BX = FFFE
jE SR
a = Jeen RRM portman |
cis
“% oy mov AX, 23 56H
Pee ios Bis AL
2 Mov 8H, AY
Tiov Dx, Bx
IL BIENTE 03, =
aes AX = 23564
BL = S¢H
ES eo
| DG eS) Sic) |e
| *
ay|| oxo =34H Mov si #0400 4
ice tcrimeen esate Mov _AXx § cst) J
eto cass| Mov cx, 057] |
near Mov pe ,Csr+8)
: INT 03 |
| oho & = 29H J
a eye ST = tre 040 OH
An > WS6H 56184
CX = 8% DH 12 34H
ye ae d=trashey 2-4,
S| Write on anembly Lanquage prog rans to fe
= Woe a eaetoory omd 04 01H tb PSS oH by)
: | O5014 :
1 a [ Mov st ,0400H
i | mov Dr, oscelll .
i | mov au, Csr |
if || Mov fpr), av —
| Mov ar ,tsr+2]
i | Mov [pret] par =
i | Naess
$ Axvithemetic — Operations :
j O| App @:- app Own, a ADDIE eee al
SS
desrinatign Some.
{ | Ade 3 addittime with isan
j ADD Ax , Bx
Aa
mae SUB Al Be AL = AL BU
Sub tract wif borvow
AL=AL-BL-e¢
2 carry Flag Chere, bovrew Flag)
Tn abit multplicabtan
|
AL acts os accumulator
Myvi BL AB= A xB
Boss > "avn. Gln
by
Higher loweyigi PAGE Wo ee
t | Ee +
wate aun el lo
of two .
[Nocakiow 0400 ond Ae multivliiation, Strre fhe! raw
7 | to_memony Location
|| ov ST, ow00 yy
7 | mov px, osoon Moo. es 4. }
7 | mov Ax, Csr) Wan le ime =
~— | mov Bx, Csr+.] ee. }
- | el des peers ans j
—| mov [px], ax }
Mov ([port2] j py
= | INT 03
_@ | bev a Payee
Fey EE aie ( Pividend. = AX, distor Bt) |
] a
\ Bucket = AL oi
Remacnder = AH
: biF .
Pay Oe ae
9 Gvotion = A
Remainder = PX
4#OOH
SS write Cle before prodvan eaeeerrs
SOO 1}f @ pis aa destination —> incvem ent—
i INC AL => AL =FEH
: | 4
j AL = FRH
: Lb
Ae LON }
z ©} ree DEC :- diatnahw~ ~ clecrement= La)
t DECH=> AL = FFH |
| 3
f | Pia Fee :
* | ae
@|| Sump instretiow = O INZ © eae |
i CRIs if zero
ONS) tavele (loop, Start; stop, again up, down )
J G next ingtyurbow d
1
oN EE) Q400 = 01 o\J
OV St ,o¥00H | Onl
Au C5) ee 15 (|
perNe sx O% 03 = oy
Mov si, Csr) o40% = o¢ \O
| App AL, seCHP dustinobion , source
0)
eae ee SF 55, HS
dot ralim > Source
2 ! \ desHnahon < source
dutinahow = source
Bl
va |
Ze | ° °
Z|
Pa |
o
eS
ay) Werke On eptbly Pog rahe to find Larges numbaccr from
e | G6 byte » whic is Sea locaton 0 400H
—||_ Mov cL» 05H O4oo = 04
a | Mov Sz, 0400H O4o} = oF
ur: SS Ov AL Gry
was INC sx
O4or = or
0403 = 03
mov et ,Cst)
CMP AL,BL
BEAL THE down
MO TU, BU
down DEC CL
uO = oy
OLS = og
INZ Up
INT 03
Eno: replace TNC with Te
erably pompacas_t0 Liroh out —poloer of ou
the no: to meme locabimn 0500 ond poney to 0501)
Mov sz, oso0y4
OH
‘ Mov Av, Csx_]
D4 ENC 5h
Mov cu, Csr)
BO Jit DaeCIa™
Atey CE4 PAA - Decimal adjut after odsution
ne ee
if lower nibble 74
~ ow AREA
i . Cerredion factor = 06H
: if Wigley nibble 24
a oye
: correction fact = 60H
as
Mov AL 54H Av=s4H |
~ eq.
gd
~ Mov gL 35H Bre Soh
| ADD AL, BL Al =AL+ BU
—
DAA Pee oy)
TOIT Oey I
= INT 03 el
—
I Find aes oral ber afters cxecwhenr & tach
= i 4
ns tru |
4 C1 @\ 004
a + oolratol
_ loeO°%liio
00000110
Joolotso
=
OM doy
© 10) ology
> ponte
lollies
2000 eT ToaNnAAAT
——___ ea
CIMINO ornrs
O8F0o pats
ae sf Saar)
0-0. ——__ a |
_o OOO————e
Ayswtr will be Jo.
[OIE AlN ea ‘
Aly]
oO \ ‘
| 1 a .
Not [owoort)
NoT AL
ie a= OO | IONON |
} | OOM Tomer
ae
AL =CAH
ination , source
OF H
= 35H
yooo itil
o\0;]
om)AND AL ,FoYW
Av +394
HII) SORORORG
O01) O10}
001) _ ° SEorS
ca) oO
AL= 304
1
L
= : Joe be Hy ati Source
= A. 2
pu oF oS oO
bE Can iy
1 Ti) {|
PAN TLRS
Mov BL 6S HW
aA a
Sai O23,
2 PUNE ©1604
©°\0 opoo
Ooo O1eoyPee =
Rito.
[2 i ae
Sea ae
e100
A)
ao oo.
po
O1oy
PCA PenCHTC nN mt)
a ie
pial Bees hh Ci lacithe alin left -
sHL— shift Nogitat lef =
TSB
a
EFL? aaa
A ee
SAL destination, com
SHL destino | count -
SAL AL,olH
AL = 02H
Mois o fio 100dOnE Tia
. : ; fe
SHR duatination count Uesicad vight shift bE)
a Ms & LS
SHR AL, O1H
AL = 000 1110)
\6+b444) = 29
a oooltlo ICY
1
be
-9
|
Oo Poll) fe) cy
vie |
Division by 2 SA cued number (floor value )
(Qn Olona) foJe ry
CC TTT
fii VN © © 1
wale. = Division by 2 of signe numbev ( ei alee)
bnabon count
et Seen
ik (lo bt iS
AL=I0H CL,=O4}
OLR a
9°01 e900 ACane
pe ic 020010 0000
meen 0 © 0 0 oO ,
C¥=0%;900 9000 —
Cy=)"eomomomono © 0}Row drsbnatton | cout
Rotate left without ene
y
RL Asabinahow , cout
L throw fa larry - }
} zt i
=e 7 :
we we two Instucbes ja ih ‘o’
CLE > Clear eavry (Clears ony initial Carry a)
| Ste = set-corry (seks cerry seen |)
t
RCR deshnation , count
ae rosea oval]
t
ay|
—| eH
—— 25H
(es
ito ck At abter exccalinn AE pape
(SLC? 12 ove
i
oD eo elt
De ot¥loa
9 =|
eBjoo! Sat 5a
—
Sting _insthucbion
d
@ | Mov sp Byte
v Sting
move ¢
DI ea
Mov dest” source *
MOV sw wad
L.
~ Sel
@ | divectionat flag
; g F ;
h BD CLD > cleay ohivectional Lag (PF=0) Auko increment
i) STD set direclimal flag CDF =1) Abo checremont
~ og
£ @ | counter
Cx
r ® REP ( Repeat)
WFO) TiN de fel not pew tt Lwill vepeok
S for shring instrchous
ae voit Lens of string COX)
io bales gd
RLV ee AH Mov CX o0vA H
ST._ ivi TSourcen memmun leAae wl Boe tees
mahign memory locate
ov ST, O40 4
Mov dL, osvoyCi) Dale
ST = O400H Pues }
> 040) ABes
aL Eee
o4%o2r
SE ee
OS 09 a %
EE = =
ee
SYD dF Sa
[eee ee See
Sls 0yo, | ——f
DL= os04
ORO O50¢
REP
fny. sting _thsthuchew
Salolmme
z| blelel | \ \\\\\\\N
WAP 40 tram fer 15 bytes st dabx From memary location
O5S00H fo O€00H wing string in structinn -
= Mov cx
OOOFH
Mov St ,0&500u
Dr ,OG0OH
REP Movse ~—
Compare strang byte
nol
Comm poyre String wool
pam Es: DTWAP to compare 10 by bes et data stored _o_rmemory
location SUOOH and os0oH. Lf sting is equal
Content of Bx = texferrond if not eael BX= OO0COy
> MN Gx ,FFFEH ,
Mov CX OO0AH
MOv ST, OY} OOH
Mov DT, 0500 H
QED
We
cmP sB
sz end.
mew ex ,d000}
erdt pHT O83[Isto sw — store seb 2
|_ | $tos nce neva — tH
| 5
| coven a= ees fess:
oloo # : os00 <— AL i :
1 O1000 7
| it asS00 1 ’
| O01 S00 ~
01g 00. =.35H.7'!
AESIDL+A » DES AX,
Z
|
OQ. slovse 1 Lona setoina wy :
LODsW — Lod string ce ies
t LOSS Soute jus Sa 5
| AL & Ds:st
Aap RS yy Soe ek
Lopss = (AL te
Au Sta aS mem i
nx 05 aa ! ee :foocessor Control | Tmtnieh! on
ecm =) Set ecare Fla a or aa
service Sudo vouttns
aie Enterrqugl” eev cevnd ce rota
“Apher executt a + rs 1 eel
Cir clear et fanor 0
C= Complement rr Plan, CFS OF
D > Sek divectionnl I _DR=4 aa String « ey
D> Clear dive ctionat DE= viele
— =m hs Sporabes iw oike (ncremed oh si]
Sse into ft ea
Tr is wed fey enol interrupt on INrR
Ting
When EF flog iweb tb iad MY execuhon ,
pol tre whtten addres on stk , poh te
ea neqisPey on He Steele and creel indecrugt
‘ een ree EPO
aac It is uso to ‘disohlemagabale taborcapl-e
6) aur — The halt inihraction vill tipo He R08E tb shop
_ = th bach
TH fee will exten’ in HLT ctoted tot is
ae Sea ha 7
sci G0) An inborn et A ignok on. NM fr
deal modi the onl a to 4 et Hu processor
Soy 6S) 4 Cialisteaes ae (1) Whine Jabexeupl Sp rok
Gi A rode sigyrel On resets pin
Lock > Wh Lock prefix is execute eo
Tear pe thay Con proceestor Jour _contvot | SY (Fen bus
| Lock pay a effed tov Stele inedcoructon aa
imSer prrcvewks a _Co= poe ear fre_chaing bay OF Ace cating|
XO memory location trod= ROR6 wots fo access. -
Loa “mov aL lst) ;
loy
NOP — No operon }
—O Yi wed to avoid oa | eee |
© Lt woy be vsed fo create Hise del vei,
@ when NoP executes proccestor doesn’ + pettormn.
nny ep eakion Hilt 4 clocle pulses oud
ees Powcer(4P) will be ee ae ;
| Be 7.
[ wary peta Bas Woutetion fe exeeubel , the sore |
entero into @ ideal state in whidk ib will wae
t perborm ae operation
O Tris wed to syne Te ae Let? 8086 ond
| $087 Crlaero pro ceesser) i