[net.micro.apple] Need Help With Apple IIE

forrest@srs.UUCP (Forrest Durett) (10/10/85)

 
 
	I am currently writing a program for a friend in the ROM Basic on the

Apple IIE and I am in need of a little help on a few things.  I am a little 

familiar with the Apple IIE and only slightly more familiar with the Rom Basic

that is included with the machine.  First, I would like to be able to trap any

control characters inside the program which would halt execution (such as 

CNTL C) of the program so that the program can be exited gracefully.  Is this

possible and if so can someone enlighten me as to how?  Second, has anyone 

heard of or posses some kind of "down-loading" program which will take a Basic

program and convert it to machine code?  I would appreciate any help that I 

receive on these two matters.  Currently I haven't a clue on either one.

Please respond by mail to me.  Thank You.




-_-_-_-_-_-_-__-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
-									 -
-    							Forrest Durett	 -
-    ...{allegra,seismo}!rochester!srs!forrest          S.R. Systems	 -
-							Rochester, NY	 -
-									 -
-_-_-_-_-_-_-__-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-

spk256@uiucuxa.CSO.UIUC.EDU (10/27/85)

To trap out Ctrl-c's, all you have to do is use an
ONERR GOTO command somewhere in the beginning
of your command...the control c will be interpretted
as an "error" and will send the program to whatever
line number you told it to GOTO.
 

ahby@meccts.UUCP (Shane P. McCarron) (11/02/85)

In article <9800015@uiucuxa> spk256@uiucuxa.CSO.UIUC.EDU writes:
>
>To trap out Ctrl-c's, all you have to do is use an
>ONERR GOTO command somewhere in the beginning
>of your command...the control c will be interpretted
>as an "error" and will send the program to whatever
>line number you told it to GOTO.
> 

Unfortunately, this is a little misleading.  Applesoft BASIC will
leave a bunch of awful stuff on the stack when it jumps off to the
error handler.  This will cause terrible problems if you try to use
the RESUME statement that apple has build in.  In one of the early
Applesoft BASIC manuals, there is a small assembly language program
that you can call to clean up the stack.  This may solve the problem,
although I have never trusted it.  There are also some locations in
zero page that hold the location of the command that was being
executed when the error occurred, as well as the stack pointer and
some other information.  These might be useful... Again, I don't think
it would be infallible.  The best scheme is to initialize your stack
and restart the program if there is an error.  Something like:

10 ON ERR GOTO 10000
	...
100 REM Main Program
	...
10000 CALL 59415 : GOTO 100 : REM Call stkinit and restart the program.

I hope this is a help.
-- 
Shane P. McCarron
Minnesota Educational Computing Corporation - Technical Services

UUCP	ihnp4!dicomed!meccts!ahby