A86: Push/ret


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

A86: Push/ret




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