Next: Exercise 2.
Up: Quiz3
Previous: Guidelines.
We consider an abstract stack machine supporting arithmetic operations and the following instructions
(exactly as the one of the course).
- push v
- which pushes v onto the stack.
- rvalue
- which pushes the content of data location onto the stack.
- lvalue
- which pushes the address of data location onto the stack .
- pop
- which throws away the value on top of the stack.
- :=
- which places the R-value on top in the L-value below it, and both are popped.
- copy
- which pushes a copy of the top value on the stack.
Translate the following C-like statement for this abstract stack machine.
x = (a + b) * (c + d)
Next: Exercise 2.
Up: Quiz3
Previous: Guidelines.
Marc Moreno Maza
2004-12-02