Programming Languages and Compilers

 

Lecture 9

 

In this lecture we will start looking at the third phase of the compiler: Code generation.

We start by looking at run-time organisation.

 

The slides for this lecture can be found here.

 

Literature

 

Watt & Brown, section 6.1 – 6.6, section 6.8 and Appendix C.

Sebesta chapter 10.

 

Exercises

 

Exercises for lecture 9 will be done from 12.30 till 14.15 before Lecture 10 on Tuesday the 5th of April.

 

Individual Exercises

The following exercises you may prefer to do on your own, e.g. just after you have read the literature, and discuss the outcome with your group:

 

  1. Do Watt and Brown exercise 6.1 page 240
  2. Do Watt and Brown exercise 6.2 page 241
  3. Do Watt and Brown exercise 6.6 page 242
  4. Do Watt and Brown exercise 6.15 page 244
  5. Do Watt and Brown exercise 6.16 page 244
  6. Do Watt and Brown exercise 6.19 page 246
  7. Do Sebesta exercise 10.4 page 425
  8. Do Sebesta exercise 10.5 page 425

 

 

Group Exercises

The following exercises are best done as group discussions:

 

 

  1. Discuss the outcome of the individual exercises
  2. Do Watt and Brown exercise 6.3 page 241
  3. Do Watt and Brown exercise 6.13 page 244