0% found this document useful (0 votes)
59 views40 pages

MP Unit1

1. The 80386 processor is a 32-bit processor that can operate in real mode, protected mode, and virtual memory mode. It allows users to switch between different operating systems like DOS and Unix. 2. It has a pipelined architecture that allows simultaneous instruction fetching, decoding, encoding, and execution. It is compatible with 8086, 80286, and 80386 architectures. 3. The 80386 has separate address and data bus lines for higher performance and easier hardware design. It can access up to 4 gigabytes of memory using a 32-bit address bus.

Uploaded by

lococo2836
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)
59 views40 pages

MP Unit1

1. The 80386 processor is a 32-bit processor that can operate in real mode, protected mode, and virtual memory mode. It allows users to switch between different operating systems like DOS and Unix. 2. It has a pipelined architecture that allows simultaneous instruction fetching, decoding, encoding, and execution. It is compatible with 8086, 80286, and 80386 architectures. 3. The 80386 has separate address and data bus lines for higher performance and easier hardware design. It can access up to 4 gigabytes of memory using a 32-bit address bus.

Uploaded by

lococo2836
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/ 40

1.

Tntmduchior b s0386

S0386 feares:
ALU
ohich
92 bi poDcesser. S ha
poDcess G2 biE olato at a bime.
ha' 8. genoral purpose 92 bi! reqisterb.
Addoes buá ib abso a. bit.
S0386 Dx Can operab wn 9eal mode, proteled
meee 4 vitual meee
JF allog users to soitch be dipferent
Operatina System4 bueh Des 4 Ünix.
6) î has pipelinod
Onrchitechure. tohich allouo
9imwteneous instru ctiah fetthine decoding, encocd
ing execuHon t menory mgmt
T ib tompatable oith 8oS6, ogR,
§o195,
80286 chitectures .e any Coce YUng under
these miD poocesser coill aßo mun n 80386 D

Popcesbor,
) The &o986 x has Sepontte pins for addess bua
4 data bus lines. This oesulE in higher pedorma
nce 4 easies hovdware design.
emoy Ogani~atiar { Segmenlabian
80386 Can a(ess Qn bit date
& bi, l6 bi'!

Conseutiue byte tocations oith dDe byle


lowe address higher bte ab the igher
olddresSheolouble oosd or 92 hit lala áored
in Hour Consetutiue bytes Locationy in memory
oith byte
at 4he
o at 4he looest doldress byte3
highest audoes.
Lb
Maximum dddresing Capauty:
8o386 has
a address bus Size
Six o! 32 bits.
Hence the to tal memmy it Can atess Can be 4
A1gabyes (2 bytes). Tuis b maximum siäe of
he maun memony
80986 has 9peua! mothod oF addresi
ng memong where in j4 bitb of selector R 32
g2
biBb oF oFfse i-e ho tal of 46 adoess C32+14)
lines at aailable for Vinhual memom
access
Bank 9 Bank Bank t
Bank o
1G xR 1G 8

k 1G bits 1G bits
B2 bito
Hg: memoy Organitahien of 8 96 D ,
divided ino ous
banks Such hoat each memony bank Contajn pb
of memony. S allouss bytes. eocrdi co dable
mumony dala to b actesseod direetly:
Plat rmodol
Tn a "Cla
flat " modo oc rmemory
Ogani2atian, 4he appl poogvamm er Sees a singr
Omay 3 bytes
ohile he physica! memoy an Contain
up to y igabytes. it toi5 usualy much dmaluet
4he Ppesse maps dhe a gigabytes Flat ápace, Onks
the phyaical addres dpate by the addares ranslahas
mechani[m.
inear addres

Linear
address
pace.
ia: lat memomy msde.
* The Segmented Molel:
Segmanted model OR memomy
organiaotran, the address space as Vieoeo by ar
app)" prg
The poDCeSSear nnaps tho G4 tera bytes logica
address
ddres
apate Cnto the physical addres apoce by te
toanslalicns, appl" ptg do not necd to
knou 4he olotails of Ihis napping.
ArchitectTheure S0386
of \0386 Dx:
Conbist ot Cental oiessíng
Onit C anagement Unit CMMU)
Bus intentoce. Dnit (BTU).
Ihe Cpu Conbiats o exeruhen unit &ingtri
Chien doco ding unit lhe execuhon unit Conbisto
S,g2 bit general purpo$ e egisesb fur bolh
address data. gt also Consist of a boarrel áhi
es u3pd to Specd the dhipt oo tat, mulHply
ivide. cperation.
The MMU Conbibts of a Segmentatish ynitß
paging. Segmentatian unit alloos he tonveS'on
Of logica address b lineom address
Paging mechaniso alloos lovenbion onm
linear address to physical adchres5 if paqing i5
enabled.
The 9egmentaHon Onit povides dour leoel ot
Poptecion poteeho applica hons , cperahin system
Cy4tem omoers kernel doorn eoch othor
CPU
Shier,
Bamel,
Muiplyl
Reqibhem Dwide effectie
addrel
bus
le
|Status
plaqs Prtecion
Unit
onto ALU Test effectiue
addresbui
ol
Contol Sequening Detode
Rom
TnternaCon ro
32
32
ploe ment
)
ue
lrucHorsheam Tnstruchicr
Decoder atnbube Reqisters De
scoiphicnSeqmentotian.
Adder input 3 MMU
queue9-detoded
PLA
bus
bitg2 Code
Prefetches
Code Byte lo checke Lirmit
PLA
attribubek CachePage AdderPogjng
phy 4jcal addey Bus
32
Transceiven Requost
Pichzen
Pipeline Address
Sixe(ornaol bus Diver BusCon
MUX BIU
tontool
top)
1/2-A31
ADS, M/ID De
Do-Dg 98608
NA RE
ing
The BIU handles all extemnal acresses by
4ha odaloet ! qenerating -the oespechue
Cont sianals
Bus Inter face Uni!: Thib Uni Include6 1he

addresb oivers, toanbceioerb for daa bus f bus


Contapl Signals 05 been in the block diagranm.
(T refetther the prefekeh
queue : 1he prefetcher
Fetches the insouc Hons fopm the extenal memeny
3 sores them in the prefetoh quete to be exerUkeo
Further, The pefetch quCLe s l6 byte in Sige.
L) Intruchon de coderr f cde toded
instuchien guelei
The instrucHon detoder takes he instyuchion rom
the prefetch queue 8 afer detodsng jti
shres
the cleocded inshruchien quQLL. The deodod them in
qupu. an dhore up three queeL deodoo instrurin
instruchon

1 Contol Rom and he Sequencng degic : The


be
Conpl Rom poooidos he. Conool dignale ho
jb5uel for the comes ponding inbtruchions , ohich
i55ued
are then Sequent ed by the Sequencing Logic.
erecukion Cnit i The exetuhon unit includes a
adder, banrel shitler 4 di.
mwHply unit
unit. TH alao in cludos the regishers, w
ateckion Unit: Tais unit is responáible
operalion OF &03&6 ohich
poptected mode
Suppots mu)k. tasking.
(UIt) Seqmentation Unit : Thib unit ib responbible
For oegmentation mechenism. T is alto an imortant
Feature hat sup povts muh toskina in popheched
mocle
(UM aging Opit: bib
his Uni} Convesto he
linear
address o physical addres5.
Tnterface Unit: BIU the name
Arates in the interface of the pooesser Dith the
Outóide corld.
T 15 responsible for al memony T)0 eaol
ote operalien
Tt has 92- bit addyes bus weli a 32 bit
data bus.
he Funchons Of BTU are;
eekebet
fetches he inshruchon From he memomy ina
4he poeletEh quee
2) Tt generates address For atessing
he code Segment Ccs) eqisteter &
4 Extended instuchiors wisg
ETnsrrurh
Pointer ( eJP).
also atcesses emoy for cata i-e manage)
hemony read a well as wite openahion:
aJso Perdorms he read 4 orite operatians
oith 4be Tlo devices.
# refe hey pre fetched G@ueue: J prefetth
queue
Fetehes he in5truchionA 4 Shores in fPO monn er h
advanted i.e be Foxe il i6s to be executed
The opexa Hon of prefetohing
Crme d by be 8I0. inshruchions is pesf
L Nee of
Prefetch Quee
ALU OP 4he prD cesser hormally performs the
exeruhon 0P dhe instmuchon at a Very hiq h spe eo
(ornpared to the insuehionb beina fetched.
2) IP 4he ins trucHon 15 prefelch ecl or Petched.
before ith exetuten in adoante hen, the poeSer
exerutin cloesn'! eiátalls & hence giue good hooughpt
oY ast exeuHan.

* Registers The intel x86 onchitechwre


regi[her
Set hos x, |6 -bit reguter f toenty tour. 3a bit
egister hese are
Base achitechue registeri
General puypose registe.
0 Instouchon pointer.
fleq oeqister.
segmant regiater.
System Regiótev
Memony management vegisten
(6 Contol gister .
Debug est regiohes.

Base Agchitechuwre eaister :


GeneYa) Punpese Reqishexy
EAx C ACcumula or): T usualy aetumulates
resutt or any ALU Opevation, but con also be
+he reg
Used as genoral- purpose. I} also coorks as a via
reqisre for Tlo bhng instouchons.

£AX ge bi reqist
AX 16 bit reqibter
AH AL
s Bae índor.

32 bit reqibher
Bx 16 bit reqiste
BH BL registe

(3)CCx Ctounten): 9 ib Used For


epeated &ting
instuchions . shi) ptate f loop instauc Hiorn s.
9
£CX 32 bil reqibler
bit reqister
bit oegister

EDx CData reqisters): T holes result af}er


mulipliCatian or dr Diisian jt holds he divide!
32 bit egibte
18 bit 9egishe
DH DL
bit reqiste

S) £eP (Base ointex ): gT toorks as qandom poinler


doo tack segment

regisle
BP
EDI (Deshnatian Jndex): J holds the deslinalicen,
data for 5fning inshouchons. Por oher inbtruchons it i4
dbed to select a locoion in data geq men
92 bi} qeqisterr
te bi! eqster

E31 (source Indox): T holds the source daba to


55ng ingtruchong. Por oJhex indtuchion i! ib 0sd to selec+
a locaHon in data begment.
92 bit reqister
SI l6 bit register

CSP (ótack Pointer ): Uged b adodress 4he unoy


Cocatiarn in the átack 5eg ment in asso cicicey oith
Stack segment neqister.
b)Tnstmuchion Peint-er: be ingtruchon Pointer ib ag2
bit qegister Calledl EP
T holds he occ sel addrebb oith in a segment
orPset is
OC he next in5trucHon to be exeruted . The
Coole
aloays nelative to he b05e Pointed by he
Seqment reqis er.
The ouwer l6 -bits of ETP Contoip Hhe l6 -bit
ibAtouchon pointer nomed TP, ohich b used Fer l6- bi':
oPCset addressing.
begmontEs4G6. Reqistens: Six, l6- bit gegmon! eisters
helda Segment beleclor values ident
he cumeHu adclrphable mmoy begnments For he
Potected mode operatian
The belecto in C5 indica les the (Uent Code
5eqmen! . 4he selecter
6eletho jn 35 ndicotes he (ument
Seqmen
Ahe
)
{ he belectoo in D6 ,Es, Fs f G5 inditale
cumen fouY data bement.
d) bysterm flaq Regstexs CEPlag'b):
Flaq 9eqister ibb a pat ot Eu. T} (ongi9h:
ng ßr 32 bit flip Plops. APlag is lip flop. Th15
7tiste inditate5 Sorme CondiHion pmduted by 1he
Xecuhon cC on in5hquchon.
A flag Can torAtain Contp) Cetain OjpereI Hions
oP he CPu.

) 5taus Plaqs
D ontol flogs
bystem flogo.
daBus flag ; here lags are dleo alledl
4he Condihonal Clags. hese. Flags inditales
Se Condihon produced after the exeruhan ot
Seme
on instTUchan.
The Sir Condiional flag
(i) Camy Flag (cE): This bit is et by amthmeic
Insuchions hat Camy or
dhat qenerat a Camry or bomow.
loty Clag (pE): Tbis bit s seh by ingtuchony,)
ir Ahe oe destinatia, Cpercnd
bitb
Contan on even numbes of 1'5.
(Ri) AuxilLiory Carry Plag (A) Thib bit s set b
he insruthions iC here. is a Camy or bomouo
aftes nibble add i'hon bubtyachan .The prpqram

(v emo flagtxe): Thib bit is Set b ,it the


rest ct an opevilian i5 XeD.
(vy Sign flog ¬se): The Signed no. Can be represe
magnitude. The
nte with Combinaion of Sign
M58 no. indicales ign o ho.

i)ovenleuo log COF) : his flag ib get , to indiaky


hat the igned esw i5 out of Yonge. Tf reswt
16 hot out of rcnge . Of remaing eset.

aontv Plag6: These flogs Gne Used t (ono!


rextain Opesa Hons Or the paoleSSUr. The threeCon)
lags
(i) ToaP flaq (T): When 1he trap flag i5 set, it
enables Aoapping lnough he oney chip debugging
loapping
featuses.
3Tnteupt flag (IE): This bit (onolg the operahon
Or TNTR 0npul pin or the Potebser. it TC =1
Hhe TNTA Pin is enahled 4 ik IF =0,he TNTR
Pin is dibabled.
Dinechian £lasCDC): Contoplo the dlirech'en OE
Stming operatians.
( bystenn laqs: These Hlag reflecky the tument
Stalus or the machine. Tbey are hormaly used by the.
cpera ling System vather han olicreent applitakian
pngsams.
(Þ) TOPL(TIp olp Priviledge (eoel) Clag:
are wwed in the pteched moele or o9R6Dy These 2 bitb
. T
holds piiledge leoel om 0 b I3, at ohich he
code i5 rUnning in ovder to exereute dny Tlo related
1n5trychon5.
Gi) Nested Tast Plag (NT): his is ato used in
pootected node. This bit io set ohen Che tast
Ihvokes another tak.

(ii) ResULme Pla Ar): This bit allouss selo ch'us


maslcing Of Some eXcepons, Whle a cocle i'4
olobugged.
0) Vm (Viytudl
(vixhud! Sos6
&og6 pode flag :Ti's ag India
he operatung oco Or the &0386. 1his 0y
ohen Jhe. R0386DX

t
Paocess inq Mode
oF &0886 : (ue processing nodes
0386 also deteminc the eatureg Hhat are oresible.
here ane
Ore 4hoer P30ceging mooles.
1) Real .
Addgess Moe
9 Paptectel Mode
3 Nittual Ro98G Mode

) Reaß and Vintual Mcdo: Real - aooress mode is


he mocle of the ppcessor imaoiately afterr RESE).
In real mode he &o386 coill appear
a fast gO86
os6 oih Some now nsrucHons
Vitual 8o86 mode ib a dynamic mode 'n in he
Sense lhat the po ces gor lan Suoitch peatecly f
9apidly bet" Ve6 mode f potected rede
he cPU enters popteehe
mode b exerute oun S086 BG9 4hen leaue Ve6
hecle entess pootected mode to tonhinue exerut.
ng naive So986 Pm. pogam,
2Pootechion Modei hib mode 16 mainly meant
Cor mulH fasking operations. MulHple tasks unni na
Simulheneously using Separate code,olata dtach
Besideg it also takes cart od pepte Secqmont
parhicula
authenhc aen of task o atess a
Seqmont.
Daka Tpes The o386 Suppor+o dollouoing data
Aypes:
Bi.
Bit Cield: a qpup of data of maxiOum 92 brts.
(3 Bit sing a Shong of Con Hineous bits or maxiwum 4
bytes n length.
Signed Byle : Signed byte data.
Onsigned Bte: unsigneo bye dala
ntege Word: igned ls bit daa.
(7 Long nleqerr : 32 bi} Signed data reprsen edl
In 2'6 Complerment forr.
Unsigped inleqer werdi ungigned 6 bit olata
(9) Pointer: it Consisl6 of a paur of l6- bi't 6elector
l6/92 bit OFfset.

et Bo986

Data Moverment Sns truchions; The data movem.


ent or Hhe data transfer ingudiany Copy Single byles
Or oords or double beweon e915texb { emony 4 also!
beln eqister AL UY A 0Y EAx TIb portb. he oata
mouement
Hon insuchions inshuchions albo include 4he cótack manipua.
e. PuSH, Pop.

2
General
Jhack
Purpose data
transfer group
ranipulation Instuchion.
3) Type Convet5an
InstrucHons.
*1> Genra purpoe
dota tran!fer group:
* Moy (Move) transfer a bute, coord dauble
Wmopm tho Rouree Coerand to the
Operand, the Moy instouH'oi3 sePuw desinahon
wefw do trans F.
ering data alon any orthese paths.
There re algo uamentb or Mov that
Operate or Segment registeb .
To reqister Hoom memo
To momoy
Bet
oom a reqsber.
qenoral registero.
Tmmediatedata o geqister.
Jmmediate olatu to a memo oy
be Moy in6houeHon Can't moue data Hp
mpmgy
to meny or aom Segment register ho Seqment reliss.
er. ëes Can
Meony- ro- emony moves Can be
be
by 4he Sring moue instruchen Movs
peoed,howeve
Mov C1o0] T200]
4
nemory
locaHon1
memog
Locatian 2
HOU CRn :(lbadh btore in Control egisten):
itruchon load 7 o Sore the (ontents

Contol reqisten (CRo,CRo,CR2 r CR3). 7he


)

POTano Siae Crx hose instrutHons i5 aluways 32 073.


Example: MOy DRS, E8X.
This InstoucHh on copies he tontenty b eg'5} ex E87
Into Jhe debug eqishex DR3.

DRni This ingtucHon lcads or sbes the


2Coniens
the debug eqister. The openandbixed
For hese instoucion% is aayg g2
bitb.
Comp)e: Moy DR3, EBx.
ThibinstrucHons Copies he Contents of geqisBer £8r
inb the debuq reqibter DRS.
Mov TRoi hib nsmuchon oads or stbres he toneb
In he. test reqistexs. he opexand size too dhese ingtruck
92 bils.
Exomple : Mov TRg, EBx.
Ihis Content in6hruciar Copies Conhent o reqister
Etx into the Test Reg ia er . TR.
xE)XCHG :Exchang ReqisBer /Memoy ojth Reg ibto:
Thi4 jns rucian erchange he
oith Contentb ct
o another
Conlentó OP a reqister
egi6ter or he Conlens of
a seqister oih Con lents od memony locoHon.
tocokin
This register can be
3/16f32 bi}.
tontents o
(On no direchu exchange the
memomy
my locaion.
Sorce e cdes hinaien mut both byieslwords
Idouble wovds.
*9>Sack Monipula kicn hion Tnlruch'ong:
i Push wlerd
ono ack: PUSH decvemen 4he !
&tack
he poin tex bt 9
If 4he. Operand Size osbute oF
insto
srack
4he ne
uction
pointen
ib J6 bitb,
b Otherwise, i decremento the
PUSH hen ploces the opevand on
he stack dop
of dhe dBack which i pointed o by
pointer.
*bs pOSH A : Push all Geneval
Reqister onb stacki
PUBA f PUSHAo lave the l6r bit o 32 bi! geneYal
general geqisters, gespectiveh.on the S0386 dBack.
PUSH A olecvermenh he dtack pointe Cbp) by l6 o
hold the eight tood values.
plsH AD detrement he dtack pojnker (Esp) by
92-bil} hold ho eah double ord Vau es.

POP: pop ord oE ack pop eplace the preuicu


Contents o the memony he register he Segm0nt
9eqister cper and oith the oordathe bp od the
&o886 brack, adtol.ssel by 35:9p o S$: Esp.
lhen poin ts b dhe heo
Erampl£ Pop Ax
Tbis instucie) Copies ho Content or the top or
&tack into Deqisten Ax
he f inonements he 5tack
Pointe by 2.
PopA Pop all
Gerexal punpoge Reqislexb acm bct
PCp A Pops he eight l6- bi} 9enevaj
er, he 9P negitterb.Horoey
value i5 di'stavded instead r loodod inb
Pop A everse a previous PusH
A, es tonng the
genera egister to heir values before
PuSH A a
executed.
The Piz4} gegistea
popped 5 DT.
Sters. POP AD
The Esp pops he. eight 32-bit genera regt
Value ib discarded inghead Of loaded
Inb EsP. POP AD everse the pre vious
ng he genera reqisten ho their values PU6H AD .7esbn:
exeruted befoxe. PosHAD
he fn6t regibter
popped i5 EDT.
3 p Convexdion Tnskruc hions:
tas cB: Convert Byo CBW tonverta the
Siqned byte in AL to a Sig ne d ond in AX by exterdine
he most Siqnifitant bi} of AL Inh gll of he bils or AH.
CWDE Converts Hhe bined ond in Ax b a double
oerd in EAX by extending he most bignifltont bit of Ax
in the too most sigpificont byteg or EA*.
ERample;
This
CBW. he M5 B or AL in al
}he
bits orInstaucHon
toill (opy
making j 16 kit Signed num ber
Ax & hent e making
In Ax ba
WD CWp ConertA the bigned ora
he mest
Sianed double LOod in Dx: AX by
extending

Significant bit of Ax inb al he bits or Dx.


Example:
bits Thib Ih8tucHon lopies the M5B O Ax nt a he
DX { hence makinq it 32- bi! Signed wo.

Convert Word to Double hlord Crtended:


CDE Conver tó the Siqned word in Ax to q
Signed double word in £AX by extending he most
Siqnieicont bil oee Ax inb all 4he l6 gs8 bitb oF ERX.
Example :
Thib instrucHor oill Copy the MSB Of Ax n
al he 1G
lG MsA kitb of EAx.

ela CDQ : Convent Double alerd to Guad aord :


Convertb Jhe Signad olouble tcond in EAx to
a siaed Quadiord in EDr:¬Ar by extendling hc mos ?
SjanifiCant of EAX ino all dhe bits or EDX.
Exa mple
Tuio ngtrucHan lopies he M38 Of EA X )n al)
{he bi4 oe EDx.
nput JCu put Tnsructinn
n date don o pot In to ant ter9 c
dato tyt C lato tord or m the prot Umbered by
be cond cpexand inb Ihe geqister Spetied bby
Ahe in st ope and

ExampleThis ins)huc W'ar oeade Ihe data dapm 16- kit


lip pt
Qut ( shres !he da la nead int he l6 bi't
i-e. Ax.

Cwput byle Or erd to a Porti cæT tronsfe


ato bye.
ox dlateu coed donm the negátet gin
Ahe Seond Gperand ho he Seteond cpean d t he Clp
Port numbered oy th dinst cperand
kample CUT 24H, AX.
lhis instructian cp'o the data lom Ax inb
4he G. hit cp peot 2

instruchons; These insto uclians


egelated
to moucment oE Plaq oeqister to oom a 9egsterk
rmmoy.

*|> LAHc : (load AH Qeqidhey dapm lags) : LAHE


Jonsdens the loo byte or he flags (oord b AH
Example : LAHE Tuis in5 ucHan wjll Copy he loLOer
the rlag eqi5tey n t 9eqi5ter AH.
iShe AH eqi5ler in Flogs; SAHr lbads
he lishe aboue coith values dopm the AH qeg
las
Sits G, h,2 f o espechuy.

Examplegister
e chas oil) Copy he lonlo»
SAHE : This jnbhu then
AH into 4he loaer .
hil h o the flag

eqi
*3)
steY.
PUSHe; fush flags enho óhack; PuSH detement 5
áhack point er by 26 Copies Hhe FLAGS.
Example ii PosHF
PosH i: Tuis ibslucian decTement Hhesh
poi nter hy otbres the value or #laq regib-er
top ot átack
*uy PopE : Pop flags OFE dhacè : poprlPofFD pops
dohle s0rd on op Of
of e óback & sbret
the ccerd
he value in the flags regiater.
Erample; PopP : Tuib inshruchion Copies he Conten
od he bp or átack into the lag oe915ter ncrement,
ot
Hhe stack pointerr cby 2.

Binamy Anthmehc InstoucHion5 he anbmetic


gorup of ingtvuchions Suppervts addiHan. 9ubHrach'an
mul HplicatHan 4 diojsien eperahiang. A) he operahiong
are perlormed cn the operand.
Aodiian instrucionsi
A\S ADD Add: ADD Per omns an inleger oddih'en
operando CDest $ Søc).
inglucion adld }he
Examole: ADD Ax,8X
Ax coith Hhat of the Bx &
Content5 gesut
Soreshe
Of 9egi%te
in eqister AX
ADC pertorms
per
*2S ADc: Add oith Camy i & SRC
tuso opexands DEST
Cddi Han op ht
in3teqer4he amy Flag Cf.

example: ADC Ax, x This inghructon adds e


Contento of eqibterr AX oilh hat op Bx alóo he
Comy dlag.
Inremen!: TNC addo b the operand 1
Camy Flag. To oFFect the omy
does no change he with a setond opesend
AbD h6HrucHen
flagi se the
OF 1.
Dxomple : INC AX : 1lus instuchon jnremanhk L.
valu of Ax by .
AAA: AsCII Ayus AFer Addien; Cyetule An

Cny follouoing an ADD in6hrucHon hat lea es a bye


yeslt nthe AL regi6ler.
Xample AAA This insbruri'on oith odius! he
re! b AseI1
Asc II addilian permed
preious
DAA, Decimad add adjustmant
adjugt mont for Addiian.
0ng HorHon
Exerule
that leves
DAA Only after exeukng an ADD
leaves a byte estlt inih Ahe AL eg stear. a tuoo
BeD- diat byte result in AL regisLojl)
ter cdiast thee;
Tuis instouctcn
Example; DAA
0o a preuopus deuimal add speratian o
poper &cD

ormat.

l) SuB: Subtract Snstouc H'ons: suB Substocts he se


nd operand (sRC) om the i'rst operand ( DEST).
Example : sUB AL, CL.i Tuis insructian subrocs theL
Conkento OFoF CL dpm AL shore the result in Al.

* 2) SB8 : Subtct ith Boroo : Se8 adds the seond


operand CDEST) bo the Camy glaq Cce) 5ubtraet the
resut onm he di cperond. (SRC).
Exomple: SB8 AL, CL: This ingtruc Hon Sub toachs 1le
Contents ot cL t Comy lag rom AL 3dves he esul)
in AL The flags anre updatee actegding ly
ement: DEC Subttract 1 b he operand.
DEC Decremen:
coes ot change he Camy lag
deerement, 4he
Exampl
Ualue e Ax : Tuis instouchen

ys AAs ASCTI diust do subtaaclian: Exeute AAS


Cny
byBe resul}
after
In the
SUB inshuctian hat leaoes the
AL Yeqister.
Eramole: AAS :This instuchiarn oll adjust he preoions
resul Subtractian b poper AscTI dorm.
*5) DAS : Deima
Adiustor Sub troachan: Exerute
4 DAS Ody after a sub trachan jngtoruchian hat eaves
a o AcD digi! byte resutt in AL Geqister.
Example DAS : h's instruchan ad just he res wW of
previous Sublaachon to ppper Dei mal FoYm.

* MuWhphicoHon. TnstoucHon:
*) MUL ; Muiply byte oox ord Cnsigneo ; MOL Den d
pestor
ns ungiqnec mwhjpicaHien. I1s Gperaned actians dependls
an he Sie of it5 operand.
Example AMUL AL, CH. us inShruch an mul Hp/eg u
AL seres he reyul; ir
contentb o CH oih that or
egibte AX.
2)percHentoTmsMULI Mulhply Byle or Word Sanad TMOL
Signee mulhphcohan, Some. dorms
implicit oeqister opeNands.
od he inshu

Exampl
Siqne e Content
IMUL Al, CH; Tuis ins ouchan mulhpli
o c) oith hct oF AL { Jores he

resut in egistey AX.


AM: Inteqen mulijply byle o oord A6CTI dult
Or nuhply: xerute. AAM Owy arHey exerubing a
thot leaves the.
ingruckicn beth o un pockeo 8CD digits
resut in Ahe AX eqibter.
Enmple: AAM
AAM : This instuc Hen coil) adiust 4heContents
OF Ax after last mulhipiaficen.
* Divisien 1

*|> DIU: Divice byhe or coord or Dauble Word Onsigncdi


DIV pedorms an Cunsig ned divisian. he cdivind
15 implicit, only he diviso is given as an operand.
This ingouc ian odiyiles he Contents
Exemple: DIV AL, CH. 7his
OF AX by CH.

*2 TDIV : Tnteger Diuide Byte or Qord On Double


divieend,
Wordi TDIV peroms a Signad alivis ian. The tie
me implicl4 alloca ted to
quohent 3 vemainder are

Example IDIU AL, CH: his inshauchan dividlos the


Cootentb dAH bj CH Brores the quohent in Signed regsb
AL oile he remaunclor
enaunclor i oored in AL.
to
A5CII ad just For diviicn: AAD is wsed
prepare uo un packed BD oigito. Foy a divgien oper
aian hat yield n unpacked resul!.
Example AAD : This instouehiah oll Condent Hhe unpathod
6CD in AY bpacked BeD in AL.

* Loqial Tnatauchons: The &0386 MP pDUIde thtt


p o instquc Hh'ens. dor mgnipulahing bi oithin all
hee byles , 0ords double oords.
*IS Boolean Operahian nstuchian:
A Noi: Not Byte or Werd: NoT inve to the operan
eemy belome 0Cxer) ! viee veT60.
Emample: NoT AX :Thio ingtruch'an will pes torm
1'3 Com pleent on he data in Ax.

: oqica AND Each bil od the resut ot the


AND ingtrut Han ds a t ip both Coma pon ding bito
OF Ahe Operanols. are t, otherwioe i! betomes a

ExoLmple; ANn AL.BH: hib ingiuchen oi) AND b


This inbBrutHan
AL 4 BH.
wibe he contets of he

*3)_0R Thçhysive GY Byte


reult od the CR ingtout Han i a is boh r at
least Dne Corespondingg bit5 o he operards Cye
ctherjbe j
nple oR AL,AH Th1'h jn)n oil) op bilwise
he content9
XOR: Exclusivc Byle or Wad: Each bit ot h
i! eilhor 6t he
4he xoR in6) )4 a

Corespon oung a 0(erD).


it beomes
Ex-OR b1F
inst oil1X-0R
Ercmple:
oT5e he
XOR. Al, BH : Thi4 inAn
Contentb o AL E BH.

(1 B1 Test Modify jns":


Dy BTC8Test): A1 oues he value ot the bit
he
lhdicateol b the boe 4 Jhe bjt oFfset ino
Cormry tlaq
Crample: B7 Ax. 8x : Tbib inst" pubs the bit no's
indiraed by 9x
Bx ce Ihe reqi5te AX inb the (ary
rlag.
2> AT6; (ei Tegt 5el): B15 3a0es he value or
a cf fset Inb he
i ndicated bs Jhe base. 4 the
Comy flag hen sre 1 in he bi!.
bit o.
Emormple ; ATA Ax,x : Thib ns)" puts 1he
he Caru
indiroted bi Br of the eqister Ax inh
Flag he value. od
9) BTR!B Test Reset: BTR Saoes
he bit orrsek inb
hr !he base
he hit indiraleol b-t he ait.
Cin
Indicated by 8x or he reqistex Ax inb Camy Flag
Complemnti 8Te Saves he aluc
4he bi indica }ed by he. base 4 the bit crfse}
Inb the Cary laq { hen Complemepth he bit.
Cany Flag
the bit uo. Indi
Pxample: BTCBTC Ax,
CaBed
Bx: bis n5}"
of ihe negistea Ax
b Ax or
puts
into the Cary Elag.

Shit} Insuc Honss:


> SHLSAL: Shi} loqical /Athmehc le} Byte or Lomd:
SAL Shig the bito of the cperand cipward
|he high order bit is shed inb the Cary Elag, { the
low ovdor bit is set to 0(xesm).
Example ; SAL Ax , cl: This ins " shib he lontents
oe Ax in he lett diecHan o CLHmes.

2) SHR : Shith Logica 9nh byte. or cEerd: SHR


Sido the bitb op he operand downwand. The lpu)
Orclorr bits shi}ed ino the Camy Plag.
Exmple; SHR A*, CL: This ing} shils he Contento od
Ax in he mght direchian dor CL Hmes.
3) SAA : Shi! a hmehe mght byte r onc: SAR
shits the bito ot 4he operand do onucand. The low rder
bit i5 9hithed into he Comy flag
Exam ple: SAR Ax , CL: This ing pertm am thmehe
SHLD
(Shitt let Double Precision):
Ahe inbt cprand pobviceel by the b olm tield
the tount
let a many bjls
nany bilb as 9pe uie
Operand.
CKample: SHLD EAX, Fcx,3: Tih in4) Shi he

CAx 9egishe.

. ) RoL: Rotate let Byte on ond : This inbt"ophats


ar by to
all he tatea bitb in a Specidied uord
the let, by emg. bi posii'ons.
xa mple: ROL AX,: This ins" ns pateg the Cortat
Ax egister by bit b let!.

2s ROR : Rotate Right Byte ox Word: Thio inst roi.


e al 4he. bit, ot Specidied aleshnalian operanol o
he maht.
ExampleiRoR AX,CL: This inst ooBates he ontents
OP Ax oeg45ter bj cL.

35 RCLi Rotat haoygh Comy le! Byle on Werd'


This in6 gptatos all the bi!b in a Spectied cod
or byte o the led!, by seme bit pesilions hovugh
Cary
Cxample: RCL AX,1: Tis inss optato the Contens
Rohats hugh Camy ong t Bite 0r
his ingh ortates all he it5 or spe cdied
CSHnatian opeand to the ngut
Erampl Ri RCR Ax.CL.i ib inh onato he Cont
ents of AX Qegiater hugh Camy by C Hmas to
ig ht.
Contol toanster instruchen:; e insth that conhol
he pongam lou ar allous charges in the preg"
Contol
Plow are Callo as branch ing or Prgran
inbiucHons.
> CALL: This ng 15 used o tanser porg
o Subvuhine or a pocedne.
eq: CAu Reg. l6.

2> RET:(Retun doom Botedue):


Enample :RET : Thib in6} Lojl! qchyrn the caler
" by getting the ehon address ar tho top of the
Stack.

3)
33 ngh taansers Contp) b a
TMP : (Sum):The jump ingr
dictosent point in the ins 3heom without oetovdina
9etuon infovmah op.
eg: SMp WoRDPR (B*]: his tns" oill qeplace TP oH
ocood daom mamory cahon poinhed by By in Ds,
a TRET/ TRETD :interup t vehm): TRET Pepo the
he intemuplad 90uhine
ins}" oetom oprm
g: TRET : This in4 he 15R.

Sing 4 chaadter Transter in6+"


Moys: (Move dhring): Tai's inst" opies a byle aror a
Od opm d locaian in the data segmont o ca

location
gi
in the
MOVS
Movs B
extra
seoment
B ; Thib in6+ coil1 taranster a byle dacm
Hhe locahon pointeo by 1 to the loca Hion pointed
b Di.
2> CMp5 : (Compare dtong) : # Compares the byle, wrd
od poioted to by the Source inde reg
O douhle pcioked to by the
with the byte o cvd or double ood
desino Hion. index eg.
eg: CMps 8.

3) SCAs : Scan s'ng): 3cA5 Cormpares the byte., wordo


double nood ponted to by the sousce fndex qegisher oit
Jho byte , crd double wepointed by the
acrumwaor.
eq i ScAS B.
)4) toD3 : (oad stnng) : This ins Copies a byte tam a
shong P0jDhed o by SI b Ax.
LODS B:
Ky $105: (store Shoira): Tt transer a by'e or uond topm
element addlvessed in Es
req- AL cx AX to he Stong element
D1.
nsor Block Stucured anguage :
NTEA : ENTE R
Creates he tack aamt. 9equirtd
block -
btauched
ea; ENTEA Q5,2: Thjsighins leoel language
oil) Create a ghoct of
25 bytes at neg Hng lewel 2
2> LEAVE LEA
LiEAVE ewerse. he achen a the
By Copying the faaDe Pointer to the shack ENTER
pointer
1n57
LEAVE Ret releas es the orack Space used by
PDLecure j6 ocal vanables.
LEAVE.

Flaq Contot) jng}D:


CLe :(cHear cory plag): cLe seto he amy
elagvegisten.
b de.if does not affect othe
Plag s
CLC.

STC 5ets he. Cany Plag b


jt does not otfeat cthex lag or reg.
STC.

a>
8> CMC: (Complemen (amy
Plag):
Seting Cay Plag. slo ohes eMc
MC TevOnDe he
eg: CMC. lagb
Chre arFected.
CLD cea5 he
lD; clear Disecien lag)i
are apFfected.
dinecticn lag no othos lags

Ss STD: (set Dise Hcn flog): 3TD Sels the dire than

*Mibcelloneous inst"
LEA : (loaal efleciue aoldres): LEA Calculates 1he
eCerhiue.addvess f stooes it in he gpetidiec o9.

9> Nop;: CNo openaien): hib ingt docs not Peatom


any insD
eq: Nop

a xLAT:(1rans late inst ): XLAT changes Hhe AL 9e9.rom


he kable. inder b the table entoy.
egi XLAT8.

addgessing Modos
Reqisher addresing Mode: h this mode data
jb 6togeo in a
usy'ng
italor oeq isler.
inbtrtjcHen .
cptode Req &dches R
Reqióters

opeNanol

'g: Reqisiex addresing.


All qegibter acept TP esecl in thib cddressing
mede.
Thib add 9essing mode ib
because he inst one Compact f hormally pretesea
daste5+ ekeruin a
OP all inst orms.
The 8161g2- bit daa qequired b exetuFes qn
Ing i4 sesent in &/16/92 bit bit geg:
i5 qiuc
along with the ins ib caled Regis ex Addoessing
node.

I)mmediate Addnesing
5 nolhing but Constant
Modes; Tmoye didle.
dia le, operand
daa (cntained io an inst
ie the Source operAnd jb a
Part o he jns) h
instead c' eg redoved
imnediate addressing modes.
|cpode Immediate opevond
ig Trnoediale. addhest ing mEde.

L)Direct Addressina Mode: To thib mode , he


fechiuc address ib taken dapr the displacement
Aield of he in4h The effechiue address ib used
8, 16 Bo g2 bit olispacenent #p0 the toment
Value r the dato Segmen reg.
Instruchcn
opcode Address A
memoy
Register

Seqment Reqister Cperanol

ig: Dinect addisirq mode.


egi Mov A I897 H?
EA 1847 H
PA = D9+ 1847 H

Tndivect addressing Mode: fh this mede 4


base or index egittex
9reqiahex Containt
Con tain8 the opexands effe ciue
address.
addoess.EA base geqistent/index reqisten t.
PA : phAital address

îngtauchon
op(ode ReqistesR

s'operand
Pointer o ppeand

Seqment Reqiste

dig: Indirect addressing mode.

Based adoressing Moole: in this mode the


Contento O a base orqibter are adoleo o
cperad 'o
cib plocement , in order b obtain he
effectiwe addoess.
EA base eqibten + 8.16 o 32 bit disp ren
TnsucH'om
\opcode Base reqI6Hes oFfse
dddresS

Reqisten

Pointer o opesand. operand

Seg ment reqióBenr


diq: Base oddres i'ng mode.
ndex addreuing Mode: gn this addoesing mode
ind px Ocqibkex'y ontento ore added b odioplare
nent to obtaio he opexand'y erpechiuc aodress.

Inouctien
optode inde oFfset
QeqisherY addoegs

memoy.

Pointer o
operand opesand

Sement
eqi5 ter

ia : Indexed addessÍnq nuode.


VITS Scaled Index Addressing Mode: Tn
this
mode, the Contento ot arn index regiot es oroe.
mulHplied by a btalina fac to of (0,2,u or 8)
which ib hen addod to he displacemen t b cbleio
he oprand's effeotiue addeestin g
EA = index 9qister dactor)
oegst er x Sta ling aiqsle

Based Ihdexel Aderessing Mooles: Ih thimud


he (onlents od he base are aolde) odl
(onter A Of an index eq istes b Compute the
Operard'5 effeciue, address.
EA = base reqister + index 9eqibher f.
=

Tnstruchor
OP(odeBase Rosnstor indeeib ter
Roineker

Reqister 5
Memomy
Pojnter to optsand
Pointes to Opeand Opercnd

Seq nyent reqjsey

ia: Based indered


addressing mode.

You might also like