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

Re: simple BASIC problem




On 7 May 1995, Dan Masterson wrote:

> 
> I'm writing a little simple Applesoft BASIC loading program for a very
> large binary game.  The problem is that the basic program starts at $801
> and goes to $B00.  The binary program bloads also at $800 and stomps all
> over the basic program.
> 
> Is there a way to relocate the basic program to another location.  The
> binary file can't be loaded at another location.
> 
> Also, this is running under DOS 3.3
> 
There is a simple approach that I know of: If you type the command,
PEEK(103)+256*PEEK(104)
you will see the location of the start (load point) for a BASIC program 
(dec 2049,  hex $801). If there is no BASIC program currently in memory, 
you can poke new values for the BASIC load address. For example,
POKE 103,0
POKE 104,32
will move the start of BASIC to 8192 ($2000). So, when you load the BASIC 
program, it will go in and run from the new address.

Then you can load the binary program below BASIC.

You just have to be sure that BASIC is not too high in memory, so that 
there is room for the variables and strings above the end of the program. 
Also, watch out for the graphics pages in memory, if graphics are to be used.

When you exit the program, you need to reset the BASIC pointers to the 
original values.

I am not sure whether you can set the pointers from within a BASIC 
program, but I think it can be handled from an EXEC file.

Cyrus Roton