[comp.sys.apple] Recovering from ONERR GOTOs

denbeste@bgsuvax.UUCP (William C. DenBesten) (04/24/87)

There is a bug in applesoft that deals with the onerr code.  It deals with the
way the 6502 stack is handled.  This affects the ability of GOSUB/RETURN and
FOR/NEXT to work properly if an ONERR is triggered from within them.  Apple
has published a short assembly language routine that you need to call from
inside your error handler.  It repairs the damage applesoft did to the stack
and allows you to RETURN and NEXT.

Unfortunately, I am at work and my // manuals are at home, but I believe that
the patch is given in the Applesoft manual that I bought for my //e.  It is
also likely to be in the Applesoft manual that came withe the ][+.  Good luck
and happy hunting.

---
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Wiliam C. DenBesten           |CSNET denbeste@research1.bgsu.edu
Dept of Computer Science      |ARPA  denbeste%research1.bgsu.edu@csnet-relay
Bowling Green State University|UUCP  ...!cbatt!osu-eddie!bgsuvax!denbeste
Bowling Green, OH 43403-0214  |
------------------------------+----------------------------------------------
There is no difference between theory and practice in theory, but there is
often a great deal of difference between theory and practice in practice.

muller@alliant.UUCP (Jim Muller) (04/28/87)

Re Applesoft error handling, my Applesoft manuals (alas, at home...)
say that you cannot simply return to the offending lines.  You must either
RESUME (I think) or execute a monitor call.  The Volume 2 of my Applesoft
Manual set (bought in 1983) gives what this call was, and says it will
clean up the stack for you.  (Sorry, but I can't remember any more details.)

(It always amazes me how much people will try to do without knowing what
they are doing or where to find out...)