You are on page 1of 4

Compiler Design

Assigment-6

(CSL0620)

SUBMITED TO :- SUBMITED BY:-


Mr. Krishna Kumar Joshi Arpit Khard
Assit. Professor BETN1CS17010
1. Convert following statements into three address code:
1. for(i=0; I <= 10; i++)
p=q+r*t|e
:i=1
t1 = r * t
t2=t1+q
t3=e
L:t4=t2|t3
p=t4
i=i+1
if i<=10 goto L
2. i = 0
while (i<=10)
a=b+c*d-e
i++
:i=0
t1=c*d
t2= t1+b
L : t3=t2-e
a = t3
i = i+1
if i<=10 goto L

1. if(i < 5)
c = p+r|s
else
if(v>=10)
a=b+e|f
else
m=0

: if (i < 5)
goto L
if(v > = 10)
goto X
t1=p+r
t2=s
L: t1|t2
t3= b + e
X: a= t3|f

m=0

You might also like