Re: A86: ret after call


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

Re: A86: ret after call




> How can I make the 'ret' command end the asm program if I jumped to it
> from inside a call

You asked on IRC and we answered you. Here is a transcript so
everyone else can see the response:

[23:32] <Xagor>  how do I make a ret command end the asm program when I jumped
to the ret command   from inside a call?
[23:33] <eightyfiv> you don't, or you jump directly back into the shell.
[23:34] <Xagor> no....I was in a call...then I jumped to a point where I want
to end the program, so I type RET, but it interprets that as the end of the
call....so it jumps to where the call was called
[23:34] <eightyfiv> yeah. you can process the stack yourself, or jump into the
shell exit point.
[23:35] <Xagor> how do I do that?
[23:35] <eightyfiv> is there only one call before the one you want to exit
from?
[23:35] <Xagor> i think so....
[23:35] <eightyfiv> then pop anydoubleregister will clear of that call's
return address.
[23:36] <eightyfiv> then you can ret.
[23:36] <Xagor> i tried that...didn't seem to work.....
[23:36] <Xagor> if you try to pop an empty stack will it do something bad?
[23:37] <aArdvarc> It will pop video memory, which will do nothing but clear
the screen one byte at a time.
[23:38] <Xagor> i think I got it to work....
[23:38] <aArdvarc> Then, after 1024 more pops, you will have a blank screen
and begin popping ROM. Popping ROM will not do anything to your calculator.
[23:39] <Xagor> uh...thanx
[23:41] <Xagor> yay! the damn thing worx!!!
[23:41] <eightyfiv> good!
[23:41] <aArdvarc> Then, after 32,768 more pops... well, just don't put a pop
in an infinite loop. How about that.
[23:41] <Xagor> HAHAH!! The ultimate RPG battle system!!! HAHAHAHAH!!!!