Re: A86: Push/ret


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

Re: A86: Push/ret




yes.
numbers on the stack are just numbers.  how they're interpreted depens
only on how they're removed from the stack.
as long as you keep track of what's on the stack and make sure you've
always got the right code address on the stack when you do a ret, then
everthing will be happy.  how it got there is completely unimportant.

-josh

On Sun, 9 Jul 2000 10:51:45 EDT Appelkore@aol.com writes:
> 
> quick question, may seem kind of simple.
> <tt>
>     ...
>     call LoadSprite
>     ...
> 
> LoadSprite:
>     ld hl,PutSprite
>     push hl
>     ld hl,charactersprite
>     ret                     ; this should go to PutSprite
>     ;... other code ...
> PutSprite:
>     ;... PutSprite code ...
>     ret                     ; this should continue after "call 
> LoadSprite"
> ; this code is obviously inefficient-- it's just an example
> </tt>
> 
> Can this be done without screwing up the stack?
> 
> 
> -- Jonathan Marcus
> Appelkore@aol.com
> 



________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.