I was wondering about those labels. The stack is labeled wrong for getting the intuitive concept across.Be careful. I think the stack begins at Stack Base. So the first value of 3 should be at location Stack Base. The first PUSH instruction would put the value 1 at Stack Base + 1.
Also, the Zero Flag in the non-existent status register would be set on the last two instructions, it's sometimes faster to check the zero flag than to compare to zero after an operation.Ok thanks!
I was thinking in RPN, the best calculator OS around, from HP. Give a 35s a try!Yeah the stack + 3 is the top of the stack, so stack base initially contains value 3. Also, ADD/MULS apparently does not delete the 2nd top element...it just takes result and overwrites top element (according to Professor for this problem only).
by Aaron Carman
by Aaron Carman
by Aaron Carman
by Jake Hertz