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

Re: Possible IIc Hardware Problems (also Re: Modem for Apple IIc)



[Note: followups to comp.sys.apple2.programmer only]

Jeff Rudis <jdr1@SHS.Starkville.K12.MS.US> wrote:

> Okay, thanks. I just tried the PEEK statement on my computer and it said
> 255, so I guess I got the crappy one... do you think this also might 
> affect the execution of BASIC programs?

Nope.  BASIC should be identical on all IIc models.

> A program I have made and am planning on marketing soon will sometimes
> screw up for no apparent  reason. It will hang up for about 10 seconds,
> then print "#1600" (my error trap line #) and boot me into monitor.

The printing of the current line number is caused by BASIC.SYSTEM
getting confused.  This is most likely due to something that your
program is doing to the text I/O vectors.

Are you making any use of the PR#n or IN#n commands, either the built-in
BASIC ones or the DOS commands?  Are you calling any unusual monitor
entry points?  Are you POKEing any zero page locations, particularly
around locations 54 to 57?  Any of these may have caused the vectors to
get confused, and BASIC.SYSTEM to be disconnected.

I see you are using ONERR GOTO.  If you are exiting from the handler
with a GOTO rather than a RESUME, then make sure you are using the stack
repair CALL listed in the Applesoft BASIC documentation (I can look it
up if you don't know it), otherwise you will eventually run out of stack
space.

The same goes for any GOSUBs and FOR loops (to a lesser extent): if you
use GOTO to get out of a subroutine, make sure you do a POP to keep the
stack tidy.  Also avoid using GOTO to get out of FOR loops unless you
have cleaned up properly with a NEXT statement.

-- 
David Empson
dempson@actrix.gen.nz
Snail Mail: P.O. Box 27-103, Wellington, New Zealand