Preparatory Exercises

We suggest the following exercises to ensure that participants are comfortable with the pace of the workshop.
  1. Understanding compilation as a series of translations . Study sample C programs and the corresponding intermediate representations (IR programs) and spim assembly language programs. You should be able to hand-execute the IR and the assembly programs and co-related them to the input C programs. You may also want to read the Hennesy-Patterson appendix on spim. These outputs are generated from a gcc port for spim that you will build in your laboratory exercises in the workshop.

  2. Shell programming. Write a shell script named 'marktypos' that reads an input text and marks the mis-spelt words surrounded by *. For example, given a file 'in' containing the following line:

    Some wds ar mis-spet in this sentence.

    The command 'marktypos < in' should produce the following output:

    Some *wds* *ar* mis-*spet* in this sentence.

    Use the program 'spell' to collect mis-spelt words and 'sed' program to replace the mis-spelt words.

    In case you have not done much shell programming before we strongly recommend the following resources:

  3. C programming. Exercises 8.10 and 8.11 (page 266) of The Unix Programming Environment by Kernighan and Pike. These exrcises involve modifying the 'hoc' program described in the book. As stated before you can download the programs used in the book from the book web site.

  4. Using make. Study the third digression on make (page 265) in the book The Unix Programming Environment by Kernighan and Pike. This is related to the exercise 8.10 and 8.11 that you should do.