Let’s Play “Compiler” !
Statement:
z = (x + y) * (x - y) ;
Rules:
Variables live in memory
Operations done in ALU
Registers hold temporary values
LD(r31, x, r1)
LD(r31, y, r2)
ADD(r1, r2, r3)
SUB(r1, r2, r4)
x:
y:
z:
Memory
Address
Previous slide
Next slide
Back to first slide
View graphic version