[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HPLOT from Machine Language
Jon, you mention Applesoft's variables overflowing. Are you saying
that your programs are writing variables into the hi-res screen
space? For hi-res programming there are a few simple changes you
need to make to the Applesoft environment at the beginning of the
program or possibly at the beginning of the programming session.
Depending on how large your program is or what memory locations
you need to use for your machine code and data there are several
ways to handle this. The simplest method is to set the HIMEM to
the area just below the start of the hi-res screen. This is really
limiting for the Applesoft program as it leaves very little free
memory. 2048-8192 ($0800-$2000) or 6144 bytes or 6k.
Another option is to use the secondary hi-res screen for output
and set HIMEM to 16384 ($4000). This gives an extra 8k for program
and variables. Better, but not great. 14336 bytes or 14k.
The best choice, assuming the program is for a 64k system, is to
move the program start to either the second hires page or right
after the second hi-res page. If you want to do animation you will
probably want both hi-res screens. To make this change you can
either use a simple loader program or use a startup program which
will set the start of program code and then load the program. Many
older basic programs will test the start of program locations and
if they are wrong, will poke the new values in and re-run the
program. An example,
10 IF PEEK(104)<>64 THEN POKE 103,1:POKE 104,64:POKE 16384,0:
PRINT CHR$(4);"RUN PROGRAM"
This sets the start of program memory to $4000 (hi-res page 2) and
re-runs the program. Notice the zero poked into 16384, Applesoft
requires a zero to be stored in memory right before the program
code starts. This method serves two purposes. Besides freeing up
memory for the Applesoft program, you also have a new section of
memory for your ML code and in your case, the font table. The
memory range 2048-8191 ($0800-$1fff) is now free for you to use.
Hope this info helps you in your programming.
--
Phoenyx
Have you fed your Apple today?
Phoenyx's Pages are back online...
http://www.dcnet2000.com/~quazar/Apple2