Re: [algogeeks] Assembly Output ADOBE question

2012-10-13 Thread Sharad Dixit
This code could've been intended to calculate some non-negative integer power of another integer, but the whole stack thing with the order of pushes and pops is weird. There are no such registers and instructions. What is it ?? cheers On Sat, Oct 13, 2012 at 6:10 PM, Ashok Varma wrote: > what

Re: [algogeeks] Assembly Output ADOBE question

2012-10-13 Thread Ashok Varma
what does the stack initially hold ? On Sat, Oct 13, 2012 at 4:18 PM, Akshat Sapra wrote: > > DETERMINE THE OUTPUT R1,R2,R3 ARE THREE REGISTERS > > START :POP R1 > POP R2 > COMPARE R2,0 > JUMP_EQ DONE_Z > PUSH R2 > PUSH R1 > SUBTRATCT R2,1 > PUSH R2 > CALL START > POP R3 > POP R1 > POP R2 > MULT