[A83] Re: TIOS push recovery


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

[A83] Re: TIOS push recovery




> 
> > 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).

He isn't refering to the ret address, just the junk generated by  the program
which leaves tios with the stack too high. They could be doing a ld hl,(some
place where stack was stored); ex hl,sp right after the return, otherwise it
should have a problem.

I don't have my calc handy but if that is true something like this should
work:

<header>
	pop hl
	push de
	push bc
	push af
	push hl
	ret

Stack is
hl (ret address)
af (junk)
bc (junk)
de (junk)

If it does correct, this should work, otherwise crash.


James L.




Follow-Ups: References: