Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Thzie atere Cale.

Cede

al cach iaidnaHaa vaiable


at Casipile

Cheno oepriialisn

3am Convienien

pcand2
X

()

The

apolox
Cpuaals
Xb
Ta T
T3
b
L
T5

Tadi oiple

cpriinzhon

he poadwcing
apliiz Cada

1
)
Tnkeymeciate Code optimiatjon
an cfhicie
Needr AeguiYcd
co dei
boro duee

taget
reMcmbevtd whe
Two imp thimg bo b

aprlying opimizakon -

1. semantic eeuvefence ofs ovrce

2
fm shoul d not change

ImproveMenb
Usk be achicved withoutchanging ago
roqraM.

Closication :
Code
opti.

MICdCRndtnt M7e 1Mdçpendent

cheracteistic
as nst
ch
Vsed for
stt &
adressing modes

Bascd on
nsts:
çharactensti o
programiny
Lang vage
Can e Achitved thsouyh following (ondt

Teachar's Signaturs:..
Aata &nst.

Lcade shou d' baanglyz cd Conple beiy v&

cade
uSC appropriate
o
iimprove
fxdm sbucre
in order
Yerget code. nrtachabte
) f xom soUY(L COde eininate
iN) Move fuo o modedenbC9| -conmpu bab
at one place&maKe wseof ye Sulk
in stes d
off compu Fing
again

Teacher's SigRature
SONCCSot ofimzab.
OPhmia Con b applicd (ocallq or

fans oma
m

oaeic blocK bhen o


cally otnywsCglobal,

iinsfomation Gechai. cs

TEMcang shin
Yon ime to Compa
l fie
Two mehods*
i Foding In Ehis, Computam of
cOnStant ísdone at compile Gre
insltad of executn bine.

Mer
22/1 sComputed at Comeile 6ime

1) (onskat propocan In this Value o

donc atcompatn time


ramole:

Teacher's $lgnaturo:..s
at Complat" Hme UglUe

LAurvg compilat.
2)[ommon Suhfxprtssion liminasion

Tt is qn tAprssion taat app tars rtpeakdy.


program whfh is Coripubed prcviovsly

not changr

<yample:

t6i b Ct+] t t
alter eliinahin subtyprtss"

9) Voviable prgeosion:
one voYfable nsk
of obher:
Teacher's Slgnature....
Exomplexp

Arophimiz4tn

4)(odeMove menb

Two busic goals code movement:


of
e: ye dvee
si2e of code (e obbain space
Complexiky
i) xeduce fauency of cxecul" of code

Loop inyqrianb comautaen

amount ofcade ovtaide khe (oap &

Caled as. code moion

Lxample:forCie 0; i<-(0;it+)
X

Cant be oplimize as

Teacher's Slgnaturei.
5)2heogn Reducbion

Sbrengbn iof Cerbain ofera bor s is


higher
slrtngbh optrator can be aceloced by law er
Shength optrators
xumple:
forCiei4-60; tt

3
a er e srengeh veducen

Count temp
temp btmpt

6) pead ode Clinainat°:


voviabíe -value is U5e d Subse uenby
Live
neve UScd
Wca d variuble vale 5

¿xample
Zpead Gade

Teacer's Slgnature:.
i2) Loop cPimira"
- optimize
iunníng bimc
CoopsbrvchrC in codeImpove

Taductr yoria ble & shrengbn otdvceon


faslieN
Li)Lop in vasank me.tnod
V) Loop un rol lin ga

Tn hs mend no of fuMe5 ond Gesfs

Can he redeced by
bq caiing code buo
Gu0

SKum P1e

while C?< (c0) whiie cikz|0)

it+)
aciTbli;

Tn this. seueal loops ane merred into

fori)to ntmd
forjit to
m
do
aCi,u:10
Teacher's Signature.
a

Code GCntg bion:

ProcesG af conpilatten
e
Takcsntemedate Cod 4s npsb
Qcncoats asgeb maChinc code as ovtput
G
yMTAG

kmedi
Co
Cude - Absotwbe
dple code

Threcáddress code Belocael1e


Abshaco synbax ree Codk
polish noatn

-ovtput o
code geneaf" îs an object
ues n
coier in/c code
following
(ode ommalty
forns
1- Absolube Code
bhat con bai s
a
m/c code tkrtnce
to acbual addrtsses ihin poqram's
-addoess gpace The qkneated cod can bt
dirccolyin MMory eexecuton
shyts Tmmediasely:
eXample- studeAE-job" Compiiers guc h

ode.
Teacher's Signature:.
)Rclvcalable (ode:

SaGcly: A
eofvcocabe bte ahecb

ocat avtomahicaly,Compiley ms
ce
boeder
o1n5sepavqbtly mpled propts

b)Asembler code :
This. Gype
Can vse fwco" of assemler
nchp in
Codetnla Tais mqies code
qtuoafslowio

T55 ves

Co de geAesahor

Mis phase mceuires, Complcte evor frec

Cnaform Casily manipulaled

Toacho ignaiurai
proams.
MeMoy MongpenMeube

ode gcnerator
inerabor mgps
(abtls n

GUwce Yogram to da ba obiecs in A

Ce de refer's SyMTAB.

nehwcton se(ecticn:

Unlosntbe K
complcftness ot ins trckion sk
s jmpoxLant factor Co de
qenerg decided
ot code td is
by
toangan
s spetd sie Sinply line by line
3
addse5s code
cadeeads o

elient.
hesiskex At ocalion

Two inpotnt aciv bfes done whie usinG

vaMahles atbil reside


Tencher's Signature:.....i
whpe ontsporn dins
speitte x9ister in
aablR side

Cevbain mAchine euire tgisky pairs

Sowe

chote of evalughon orde

iching vp best orde is

Consecole
Chkments in which louw of conbrol
(nbers att beginning leancs at end
ekhovb ha lG os possibilb of banchong

Teacher's Signaturei...

You might also like