[A83] Re: Stacking


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

[A83] Re: Stacking




If by it doesn't work, you mean it crashes, it's because you changed the
stack pointer but then you're returning. You need to restore the stack
pointer after you change it. But if you intend to crash the calculator, you
might as well just do something simple...

-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Ronald Teune
Sent: Monday, July 16, 2001 11:06 AM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: Stacking



.nolist
#include "ion.inc"
.list
#ifdef TI83P
        .org    progstart-2
          .db     $BB,$6D
#else
        .org    progstart
#endif
        ret
        jr      nc,begin

        .db     "DeztroyThaVAT",0
Begin:
 ld b,$FF
 ld hl,$0000
 ld sp,VAT
loop:
 push hl
 djnz loop
 ret
.end
END


How Evil Is This >:->
However, it doesn't seem to work.

>Good point, I had written the message before I thought well.
>Point of concern is that you must remember to put the stack pointer at the
>END of the memory block, in the example case:
>ld sp,plotsscreen+300h
>
>If you don't, then PUSHES :-) will corrupt other data.
>
>Thanks for the correction.
>--(Peter-Martijn)
>
>>
>> Popping doesn't corrupt data anyway, only pushing does.  And if your code
>> doesn't manage it's pushes and pops properly, it's likely to crash no
matter
>> where the stack pointer is.
>>
>>
>> In a message dated 7/14/2001 10:38:20 AM Eastern Daylight Time,
>> hyper@hysoft-automation.com writes:
>>
>>
>> > Well, I meant that if you need to be careful, since if you pop a little
too
>> > often, you end up corrupting data.
>> > Also, I might have misinterpreted some previous posts about using the
stack
>> > pointer, and I actually added the statement to point out that I do know
>> > about
>> > the dangers.
>> >
>> >
>>
>>
>>
>>
>> ----
>> Jonah Cohen
>> <ComAsYuAre@aol.com>
>> http://jonah.ticalc.org
>>
>>
>>
>
>
>





References: