Re: A86: Re: Asm questions


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

Re: A86: Re: Asm questions




If you want to be sure the stack is ok, you can save it before your code and
restore it afterwards:

stackSave = _textShadow  ; [2]

ld (stackSave),sp        ; save stack pointer

...
code
...

ld sp,(stackSave)        ; restore stack pointer

But trashing the stack is considered a very bad programming practice.  If
your code trashes the stack every time it runs, then you should fix the
code, because it probably has more problems than just trashing the stack.
Saving the stack should be reserved for exiting out of a program in case of
a fatal error.

-----Original Message-----
From: Ironma n <ti_86_asm@hotmail.com>
To: assembly-86@lists.ticalc.org <assembly-86@lists.ticalc.org>
Date: Monday, November 23, 1998 9:48 PM
Subject: Re: A86: Re: Asm questions


>and thinking of that is where anyway to get how many time something has
>been pushed (there is some thing that has the valu of the top entry or
>something like that but i forgot) so you could loop it so that your calc
>does not crash?