Preparatory Exercises
We suggest the following exercises to ensure that participants are comfortable with the pace of the workshop.- 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.
- 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. Some *wds* *ar* mis-*spet* in this sentence. In case you have not done much shell programming before we strongly recommend the following resources:
- The classical book titled The Unix Programming Environment by Kernighan and Pike. An Indian edition from Prentice Hall of India is widely available. You can download the programs used in the book from the book web site.
- An online book with the same title: The Unix Programming Environment by Mark Burgess.
- An online course on Introduction to Unix.
- 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.
- 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.