SLIDE 1
2
Code Generation The Main Idea of Todays Lecture We can emit - - PowerPoint PPT Presentation
Code Generation The Main Idea of Todays Lecture We can emit stack-machine-style code for expressions via recursion (We will use MIPS assembly as our target language) 2 Lecture Outline What are stack machines? The MIPS assembly
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
and $t1 (a temporary register)
17
+ offset into reg1
← reg2 + reg3
at address reg2 + offset
← reg2 + imm
means overflow is not checked
← imm
18
19
20
21
22
23
24
25
26
27
28
29
,…,xn ) push the arguments xn ,…,x1
30
31
32
33
34
35
36
37
38
39
40