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

Re: Please help with BinSCII



On Mon, 03 Jul 2000 00:22:45 -0500, Rubywand <rubywand@swbell.net>
wrote:

>     It sounds like you are saying that, after running a program using an
>ONERR GOTO without doing corresponding stack cleanup CALLs, you will end up
>at the BASIC prompt with top-of-stack being positioned lower than usual. How
>did you determine that this happens?

On my IIgs, I launched BASIC.SYSTEM and typed in this simple test
program:

10 ONERR GOTO 30
20 GOTO 20
30 END

I then dropped into the monitor and typed CTRL-E and pressed return
and noted the stack address.  I returned to Applesoft and ran my
program and pressed CTRL-C to cause an "error" and I was returned to
the Applesoft prompt.  I again dropped into the monitor and typed
CTRL-E and noted that the stack address was not two bytes lower than
it had been before.

I just double checked it again and did a couple extra tests.  If you
just have the program:

20 GOTO 20

and run it and end it with CTRL-C the stack stays at the same value.
If you have the program:

10 ONERR GOTO 30
20 GOTO 20
30 CALL -3288: POKE 216,0

and run it and end it with CTRL-C the stay stays at the same value.

It is only if you use the first program, which uses an ONERR GOTO
statement and doesn't clean up the stack that the stack pointer
changes after the program is run.

>     A mod which would improve speed is to accumulate the chars in a string,
>say S$, and do a PRINT to BINSCIIX (of S$) only when at end of line.

Possibly, as long as garbage collection of variables doesn't slow it
down too much.  String manipulation can be quite slow at times.
However, I'd actually have to try it to be certain.

+------------------------------------------------------------------------+
| Jeff Blakeney - Dean of the Apple II University in A2Pro on Delphi     |
|                    Delphi Apple II Forums Web Pages                    |
| A2: http://www.delphi.com/apple2   A2Pro: http://www.delphi.com/a2pro  |
+------------------------------------------------------------------------+