Monday
April 21, 2014

Homework Help: i need ur help in compiler construction

Posted by MarY Queen on Sunday, January 21, 2007 at 4:42am.

Q: Given the following 3-address code

1: a = 1
2: b = 2
3: c = a + b
4: d = c - a
5: if( d < 20 ) goto 11
6: d = b * d
7: if( d > 20 ) goto 11
8: d = a + b
9: e = e + 1
10: goto 6
11: b = a + b
12: e = c - a
13: if( e < d ) goto 3
14: a = b * d
15: b = a d



(a) What are the basic blocks for the code segment?


(b) Draw the control flow graph (CFG) for the code once you have determined the basic block.



Given the following 3-address code

1: a = 1
2: b = 2
3: c = a + b
4: d = c - a
5: if( d < 20 ) goto 11
6: d = b * d
7: if( d > 20 ) goto 11
8: d = a + b
9: e = e + 1
10: goto 6
11: b = a + b
12: e = c - a
13: if( e < d ) goto 3
14: a = b * d
15: b = a d



(a) What are the basic blocks for the code segment?


(b) Draw the control flow graph (CFG) for the code once you have determined the basic block.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Compiler Construction - Given the following 3-address code 1: a = 1 2: b = 2 3: ...
compiler construction - Given the following 3-address code 1: a = 1 2: b = 2 3: ...
Computer Information - A __________ provides the tools that a programmer uses to...
POEM FOR MS.SUE - I LOVE UR ATITUDE UR SO KIND FOR ALL UR KINDESS YOU NEED A ...
Math ---Helper - Helper I really need ur help with some of my math questions ...
programming - I have just started C programming after a semester of Java. I am ...
social studies fair need help badly.!!! - my social studies fair project is due...
ethics - Write a 1,750- to 2,450-word paper that formulates your personal code ...
BUS 210 - Imagine that you are starting your own company. What will be the ...
medical coding - what is the corresponding HCPCS Level II code for HCPCS Level I...

Search
Members