Re: LZ: User stacks


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

Re: LZ: User stacks



On Sun, 6 Jan 1980, s_wrobleski@foma.wsc.mass.edu wrote:


> list-zshell@defiant.rbk.sollentuna.se wrote:
> > 
> > On Tue, 6 Aug 1996, Eric C. Jensen wrote:
> > 
> > >      Can someone explain how to define your own stacks???  I think I have
> > > some idea, but I don't quite know.  Do you allocate memory and then
> > > allocate a seperate variable to be a stack pointer to manipulate it?
> > 
> > Basically, you decide where you want the new stack to be, and you load
> > it's address in SP and you have a new stack.  You also need to save
> > the old value of SP in most systems, and restore it before your program
> > exits.  I'm not sure if that's true of the TI.
> > 
> > Barry
> 
> That would probably be a good idea, as the ret at the end of the program
> wouldnt return to zshell if you didnt restore the old stack..
 
Makes good sense to me.  In some systems you terminate a program by
jumping to a certain address, not using a return, and it restores
the stack to its own liking.   CP/M, for example, worked like that.
You terminated a program by JP 0.  I forget how TRS-Dos did it.


Barry
 


References: