[A83] Re: "forget" ret with calls ?


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

[A83] Re: "forget" ret with calls ?




Would it be bad to put it at the end of your program? I usually put all
the variables and stuff I need stored at the end....is this bad?

Thomas Lutz
Stevens Institute of Technology

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org] On Behalf Of Peter-Martijn
Kuipers
Sent: Friday, December 28, 2001 3:06 PM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: "forget" ret with calls ?


> Sorry, just to be sure, is it
>=20
>=20
> Like this:
>   ld (stackvar),sp
>   call some_code
>
> some_code:
>    ;code
>=20
>    ld sp,(stackvar)
>    ret    ;return to TI-OS
>=20

Yep,
Be sure to equ stackvar to some safe memory place as well

=20
>=20
>=20
>=20
>=20
>=20
> >From: Peter-Martijn Kuipers <hyper@@hysoft-automation.com>
> >Reply-To: assembly-83@lists.ticalc.org
> >To: assembly-83@lists.ticalc.org
> >Subject: [A83] Re: "forget" ret with calls ?
> >Date: Fri, 28 Dec 2001 20:29:33 +0100 (CET)
> >
> >
> >Simple,
> >
> >pop a variable, directly after the label you called to, and you're in

> >business.
> >though this only works if you haven't popped any vars on the stack
before
> >calling
> >
> >another approach (safer!!) is:
> >store the stack pointer to a safer location.
> >restore the stack pointer before calling...
> >
> >at the start:
> >ld (stackvar),sp ; stackvar is a locationyou choose to be somewhere
in=20
> >saferam
> >
> >at the place you want to exit:
> >ld sp,(stackvar)
> >ret
> >
> >--Peter-Martijn
> >
> > >
> > >
> > > Is it possible to make the calc "forget" it was busy doing a call,
so=20
> >that
> > > when a ret command is given in a call the program returns to the
TI-OS
> > > rather than returning to the place where the call was made?
> > >
> > > Thank you,
> > >
> > >     Hasan G=FCd=FCk
> > >
> > >
> > >
> > > _________________________________________________________________
> > > Join the world=92s largest e-mail service with MSN Hotmail.
> > > http://www.hotmail.com
> > >
> > >
> > >
> >
> >
> >
>=20
>=20
>=20
>=20
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
>=20
>=20
>=20








References: