[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible IIc Hardware Problems (also Re: Modem for Apple IIc)
In article <55u65v$28q@news.emi.com> drsmooth@relex.com writes:
>[...]
>Does your program even *get* to the error trapping routine? Maybe you
>need to use this wierd routine that I found in the Applesoft ][
>manual? (If anyone knows what this routine is, and what it does, I'd
>love to know; it is mostly a buncha POKEs, and it says it is to be
>used when encountering 43+ errors.)
What those pokes do is set up a short machine-language subroutine that
fixes the 6502 stack after an error occurs. The Applesoft error handler
has a bug in it--it often leaves extraneous junk on the stack, which has
a number of bad side effects: the RETURN statement can't find its
corresonding GOSUB anymore (since GOSUB/RETURN uses the stack to remember
where to return to), the NEXT statement can't find its corresonding FOR,
etc.
CALLing that machine-language routine from inside your ONERR GOTO routine
removes the extraneous junk from the stack, curing the above problems.
- Neil Parker
--
Neil Parker, nparker@{cie-2,cie}.uoregon.edu, http://cie-2.uoregon.edu/~nparker
"Bad move, Neil!" -- The Tick