Re: A92: Stack and return values


[Prev][Next][Index][Thread]

Re: A92: Stack and return values




Aaron Hill wrote:
> 
> Hello all,
> 
> I want to use the stack to return a value.  Because JSR stores the PC on the
> SP before jumping and RTS needs this value intact, I can't just push the
> return value on the stack.  Does anyone know how I can do a return value
> without using the data registers?

Easy - just pop the RTS value to a temporary register or variable, push
your return values, and the push the RTS value again.


Follow-Ups: References: