[A83] Re: TIOS push recovery


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

[A83] Re: TIOS push recovery




Haha.  Nice try.  Ignoring that little random bit, which is pointless to use
for such a test, use a known value like $0000 that will cause problems, the
code does nothing.  All you are doing is putting junk on the stack.

>   pop hl

Now HL contains the return address, and the stack is "empty" (as far as the
program is concerned).

>   push de

Push some junk on the stack.

>   push hl

Push the return value on the stack.

>   ret

Whee, we go back to the TI-OS.  And the stack is 2 bytes larger.  Sure,
maybe it does clean the stack.  Doubtful, but maybe it does.  It is not
really relevant, since the chances of a program doing something like this
are next to nil.

That would be an interesting trick.  Make a program like a game that
randomly increases the stack size.  Assure that it's internal stack is ok by
moving it somewhere safe.  Have people wonder why the TI-OS is crashing in
random spots after playing.

> therefore, I would assume The TIOS has some error correction for that
> weird...

No.  It can't.  You have to RETurn to it.  You either return, or your ret
goes off into never-never land, and more than likely bad things happen (1 in
65536 chance of being right).






Follow-Ups: References: