Lecture 12: Instruction Sets and Code Generation

Eelco Visser
Lecture | PDF
November 26, 2020

In this lecture we study target machine architecture and their instruction set, and we start looking and code generation. We study the operational semantics rules for arithmetic expressions in ChocoPy. And we explore the translation of arithmetic expressions consisting of integer constants and additions to RISC-V code. The code is somewhat naive, since it can run out of temporary registers. Possible solutions are to store temporary values on the stack or the use register allocation. We end with looking compilation schemas as an abstraction from the implementation details of transformation rules.