# compiler construction

posted by .

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.

## Similar Questions

1. ### i need ur help in compiler construction

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 …
2. ### Compiler Construction

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. ### C++ Programming

#include <iostream.h> #include <stdlib.h> #include <math.h> int main ( ) { double noe, nod, dc1, dc2, dc3, dc4, t; cout << "Enter number of eggs: "; cin >> noe; nod = noe / 12; dc1 = .50 / 12; dc2 = .45 …
4. ### C++ Programming

#include <iostream.h> #include <stdlib.h> #include <math.h> int main ( ) { double noe, nod, dc1, dc2, dc3, dc4, t; cout << "Enter number of eggs: "; cin >> noe; nod = noe / 12; dc1 = .50 / 12; dc2 = .45 …
5. ### Computer Information

A __________ provides the tools that a programmer uses to create software. a)compiler b) interpreter c)code d)a programming language In a way, don't all of these help a programmer to create software?
6. ### MIPS Assembly programming

Hi there, I need to implement in assembly mips an iterative binary search method. Here's my code: # this program implements binary search # the equivalent pseudo code is the following: # first = 0 # last = size -1 # while (last - first …
7. ### programming

1.which of the following statements allows many branches or alternatives paths?
8. ### Computer Literary

Which of the following is Not an example of debugging A)Looking for errors in programming code B)Fixing misspelled commands in programming code C)Solving faulty logic in programming code D)Upgrading to improve the programming code
9. ### programming in basic

1 If four statements are entered with the same statement number, the computer will accept the ______ statement with the duplicate statement number first second third fourth 2 ______ is a valid BASIC number?
10. ### statistics

A zip-code is a five-digit number identifying where in the U.S. an address is located. The first four digits in a zip code can be any number 0-9, but the fifth digit cannot be 0. In addition to this, each address has a “plus-four” …

More Similar Questions