0% found this document useful (0 votes)
10 views

CD unit 5 sem6

Notes

Uploaded by

reddyharsha994
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

CD unit 5 sem6

Notes

Uploaded by

reddyharsha994
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

in tested, sakun ts

ees
Cos
xect to suples
Quad
Keadily done gene the
of
Consists
Psoqsan
Sousce
tuo
? qencsalebe tedimelemen
the easily notahon
Postfx
as x
Synta
salos code -C)rft)
ge be sale hould l as
can bothe as
qenc Such
s honSoch
taxePsescn
Code that qcne[atoy euing henesatox.selechono
allocahion.
Keqistex
00
be
Can
O0000 0001 Such
to ment tion the
the oxdes
Evalah'on tahon
e n d h
fosm d le be Psoqsam
agt
manaae aa of Sentaiorns
a Convests expcc Code qene talon
xeprésen
sepsesentahon
Intermediate SUch 8ep6esen
ot chine.
ma aise :
Can Code end
a O n tox
stsuchon code
Ocsign
into iSqenesatox
the itthat moy sa seotahon
Bepse
’lineas
tor the
byekecoted of
isSueS to
tained. Gene fsent machine seese
Input me the and
daqs.
qenesa
Code Phase...ha
’addsess
hsee
Unit-sthe away owing
Desigoning
o0, Such Code to lntesnediate
, ’hsaehical
main . " by
In Code Saosce Input doced
lssues
code foll to
Code.
code. and
The of A The lnput The Pso
d, i,
) + O i,
Compiled sont qenerated,
dcotk
exe to qenesatd
ltu
Pottant
Im
axe detesmined
turqetied f
the
Source 3e}exs be s
the
a
in be
by is
JumeS
should Poqum
i
placrd Can the
done Sttements isCode
o4
is made guomelnstuchon,
nstuchon
FosJasd idioms
and name
bt
qenexatoY in is machine tasqet
can location is objects the qeneacd
Imne qenexation nameS Hreeaddses5
JUmpPoocessedthe
machine size.
ItI fea-saldy tot esqet of
code lansyagc: the
data
of
entsy ethüeniy the and
i buckoas and
Code Manaqcmenl selechon
the aAssembl
lanauage: o} of sPeed
its
by
psogum
Taxqet
2) of machine addsesseS the
ble
he Symaolta is ilcd.
ase
Instuchun5eeeds qualihy
ao Unilosm
and factoss
hen
ouleot the I stuchon
In
4) d.Considese
when Ahon
AAbsolole menosy and A
name
Example InstwL The
The to
the The diy
Cnd
3) J, ,
fo example

Can be xanslate d into


d = ate

mov b, Ro

mov
eliminakd
mou aeoThis Cán be

Co de tsans letion,

S) Keqis tex allo(ahon .


is Sub divided into hso Su b psoblems
the USe of eistes
of vaxiables that will
seside
+ Keqistes ollo aigni the
se
Póoqtamn is sclected.
in eqistexs in the Póoqsamnho
assiqnmentthe seeci}icxeqistedthat a Vaviable
* Keqis tr

?
6) Evalu hion O% des
osdex in which
d the Code qene satox decides the
the Instsucton oill be exeuted.c e
atBetshe ethueny o
n, The osder of Com puta hons
the tatqet Code.
ComPutu hionl ox ders, Some wl
Qlrnong hold the Intsmedake
Sequise only tewex deqistess to

V, Picking Hhe best osder is a dilholt task


qenesatox.
(ode Paoq
Xum
tasaqet what the aton
time
und
equiValentphase
the
of Sequencee
segistesS
oplimizing of se
whe
Statmcoi
aeesesentation Genesatoy tsack
a Ovom
ocahon
an Code fos
the 4ox keee
eut
oul Codeetiectfvely th
see-
addess
is the
Used Intesmediak 4o
mnodelmediate
Intex Code tasqt S,
statement Used Can
Aechinqoes :
qeneouho
(ode 3=
(ost Caifloss aeqistess
each
in
and =1 2=
ComnpilesPsuduces tes Ri0St nqme
Symbol Cost iS
descoipox
Genexalox Code
0Ptimize
table qenesa the
Statements 1S
a Des descsietod the
of
SouxCe genexahon
an
and
Pxoqrem Genexaloy ot
in Addsess
Inpu RRi
phase tasqel
psoqsambejose i
mediate
Inde& pesands
Code
Simple s de
Co addsss c
Keqislex Value
CUssent
Code AODADD and Custently
nal takes Code o
-
f The tont
End thseestoxe IKeqistex
The lt Simple
A
The is
Ulb, of to
ii, ii, SouseSoste
I,
P
Code henesa ion nlqosidhrnotshe
The Code qenesahion alqosithn is the Co6erof the compiles.
i
seqistex and addsess desciploss then qenesutes
, 4 sets uP ceU- level contsol
machíne
instuhions that qive you
psoysum.
alyosithm is split, into foux pasts ase
i, The
O KegisBes destipo Sct Up.
) Basic Block qenesaion
) tnstxuchun genesation
Ketusn Command.
Code fox Assignnent statements
Genesating
d:= (a-t)t Ca-c) t (a-c)
t a-b

Kegister destsietoy Addsess dest atoy


Statemernts coe Genesale d
mov a, Ko
Keqistex empy A in Ko

Mov Ro Contins L t in Ro
SUB C Ri Ri Contains u, u in Ki
Ro Contains v u in Ki
V=ttu ADo R Ro
Ri contai ns u Vin Ko

mov Ko,d Ain Ro Cnd my

* lnde xed Assig n ments .Code hene sahing


statements Cade henesated
mov b R),R 2

aliJ:= b mou ba(Ki) 3


Pointex Assiqnmenl code henesa hng.
Cost
Slatement Code qeneta ted
Mou Re,a 2

moV a *RP 2

Code ox (ond honal statements :


Genex
esating
statements ase Pasl of any Psoq tum ming (onstsuct
i, Conditiunal
to take an appsopsiate baunch.

, Cond tional TumpS axe imPlemented by finding out


the
value of the seqistes.
Casc - 1:

subtsaching1
The code that genesae d s hauld invove
loca hon
seqsteg and then Jump to
Jsomx'!which is in
-Ve

Case- 2 ositive
Se ts the condi tion code to
Cmp Xy

Case-3
if values
C < J u m p to

Examele

go to z

how the tasqet codes att..

mov Ko, X

CJcZ

You might also like