Runtime Organization: Stack Machines11-06-stack-machines.mp411-06-q13
block2x2-1
411-06-q1.pngSince 6 is on the top of the stack, we know 2 * 3 has already been computed. Additionally, 5 has already been loaded into the accumulator. The next step is to add the two together, storing the result (11) back in the accumulator. If you are confused, try drawing out the state of the stack and accumulator after each line of generated code, as shown in the previous slide.