Re: A86: calling and returning


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

Re: A86: calling and returning




here is a good way of doing it

start:
 ld (exit+1),sp
;code goes here..
;.....


exit:
 ld sp,0000

that first load will replace the 0000
then when you exit the sp is restored

bacisly you can think of a call like this

call xx becomes 
push pc \ jp xx

and a ret is just pop pc



--- Brent Schneider <brent@calc.org> wrote:
> 
> but, I haven't pushed anything.. so what do I do? is
> there something about
> the pc counter?
> ----- Original Message -----
> From: Cassady Roop <croop@oregontrail.net>
> To: <assembly-86@lists.ticalc.org>
> Sent: Sunday, December 05, 1999 8:41 PM
> Subject: Re: A86: calling and returning
> 
> 
> 
> Either pop everything you've pushed, and pop for
> each time you've made
> an unRETurned call before this, and then ret, OR,
> COME TO THE DARK SIDE
> and take the cheater's way out which I am quite fond
> of using whenever
> I'm in too deep:
> 
> jp _jforcecmdnochar
> 
> this will take you back to TI-OS no matter how much
> you've screwed up
> the stack.
> 
> Cassady Roop
> 
> Brent Schneider wrote:
> >
> > Say I did this:
> >
> > .....code......
> > call label1
> > .....morecode.......
> > label1:
> >  ret
> >
> > how would I make it so that ret would return to
> the os, instead of back to
> > where we called it from?
> >
> > thanks
> 
> 
> 
> 
> 
> 
> 


=====
later
             matt c
             <a href="http://junkworld.cjb.net>junkworld.cjb.net</a>
__________________________________________________
Do You Yahoo!?
Thousands of Stores.  Millions of Products.  All in one place.
Yahoo! Shopping: http://shopping.yahoo.com


Follow-Ups: