The intermediate language we have used in Chap. 6 is quite low-level and similar to the type of machine code you can find on modern RISC processors, with a few exceptions: We have used an unbounded number of variables, where a processor will have a bounded number of registers, we have used high-level instructions for function definitions, calls and return, we have assumed that any constant can be an operand to an arithmetic instruction. Typically, RISC processors allow only small constants as operands, and in the intermediate language, the IF-THEN-ELSE instruction has two target labels, where, on most processors, the conditional jump instruction has only one target label, and simply falls through to the next instruction when the condition is false. The problem of mapping a large set of variables to a small number of registers is handled by register allocation, as explained in Chap. 8. Functions are treated in Chap. 9. We will look at the remaining two problems in this chapter.
KeywordsInstruction Sequence Destination Register Target Label Register Allocation Machine Code
- 1.Aho, A.V., Lam, M.S., Sethi, R., Ullman, J.D.: Compilers; Principles, Techniques and Tools. Addison-Wesley, Reading (2007) Google Scholar
- 2.Appel, A.W.: Modern Compiler Implementation in ML. Cambridge University Press, Cambridge (1998) Google Scholar
- 3.Larus, J.: Assembler, linkers and the spim simulator (1998). http://pages.cs.wisc.edu/~larus/HP_AppA.pdf
- 4.Muchnick, S.S.: Advanced Compiler Design and Implementation. Morgan Kaufmann, San Mateo (1997) Google Scholar
- 5.Patterson, D.A., Hennessy, J.L.: Computer Organization & Design, the Hardware/Software Interface. Morgan Kaufmann, San Mateo (1998) Google Scholar