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

Implementation of A Three Address Code

The document discusses advantages and disadvantages of different code representations, including triple address code and quadruple code. It provides examples of how arithmetic expressions would be represented in these code forms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Implementation of A Three Address Code

The document discusses advantages and disadvantages of different code representations, including triple address code and quadruple code. It provides examples of how arithmetic expressions would be represented in these code forms.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

QUADRUPLE

VANTAGE
DlSAD ADVANTAGE felds -4

Quick,Qcecs
TampEortan,
vavtablepora ot
|MPLEMENTATION

eloatin
Qses
time
CODE
mpot code

vuables
for OF
globat THREE

ostinsaton ADDRESS

space

tabe
hen a- DISADVANTAGIE TRIPLE
bt¢a= -
must beTmporaut - a
- a-b
Djaut when adoesnot
opuaor, - prant
pointa
Asapl o
to mak
() pdatd optutue that to
opahy
(0)
is
iu g',ag se
Stat inmplit
moved,
(pt to o
+
pator 2. anothee any b
y
annvlve,
cthexofhen eochra
mQung toples
b nteumodlata
Buplh eeasuanga
code to tanpttmp
wae
(0)
autuoing vaiabk
C a 9Uult
is
coda needac,
to4 ) to
() (0) sBet
d=a a-btc
INDIRECT
TRIPLES
xnd - to
iple
Zempo»asiauquusabut
() (O) Computalin
+
taty a
4pauless %
made -
paintvr
emjicitand
Compoed
thanit. to
to
(o) C
parataystoaednd the
ethg
|5 14
geasanpe
code.to
pant
tot s
eyons al
Iuplthu statement
*pasentabon
Fable
EXANPLE I a = b, * -c, +, b * -c a= (b -) t+ (b*-c)
INDIRECT
TRIPLE
QUADRUPLE TRIPE
THREE ADDR6SS CODE c t a t r

statr

ARG ARG2RESULT AR&I ARG2 GTAYSA

uminus C t (o) wmins (o)


ty = wminus c (O
b t b 6)
(2) uminus (2 (uminu C 22

b t tg (3) b t4 c3) b
te ts
ts = t t ty (4) () () (3)

a ts () ts (S) a

2-PHSt a t

dag
Example 9 () (y+(z+yt
THREE ADDRESS CODE
OVADRUPLE TRIPLG 1NDIRPCT TRIPLe

AATE
# OP ARGI ARG2 RESULT AREIARG2 NENT

(0) ty (0) + (0)


N N
t ytz () y b2 + 2 ()

(2) ti (2)
N
(8) (3)
tq=, t+z by |(3)
+
(o)

ts t3+ty + tg ty ts ( (3)

You might also like