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

Re: simple BASIC problem



Tony Diaz (tdiaz@coyote.csusm.edu) wrote:
: Dan Masterson (dmasters@freenet.columbus.oh.us) wrote:

: > 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.

: Can you do it all with a text file?

: Then you just need to exec the text file.. DOS 3.3 can be patched to 
: EXEC HELLO on startup. 

: This is provided that the same program isn't also loading on top of DOS 3.3

That would be my solution as well.  I presume the binary file is an
executable once loaded.  Alternatively, you could load the binary file
high and have it self-relocate when run.  Either way, your loader gets
stomped when the binary file reaches its final resting place.

It is possible to change the load address of Applesoft code, but doing so
requires the use of some kind of loader for the Applesoft.  It just
involves changing a couple of memory locations that I don't have handy
(but could look up...I'll keep this problem in mind), then loading the
program.  I've seen two methods for doing this (both, ironically, used by
Beagle Bros...)

METHOD #1:  To run the Applesoft program, the user EXEC's a text file. 
The text file resets the Applesoft load address, then loads and runs the
program.

METHOD #2:  When first run, the Applesoft program looks at its own load
address to find out where it is.  If it is at $801, the program resets the
load point, then runs itself again off the disk.  Naturally, this works
best if the program is fairly short (i.e. short load time).  The
advantage, of course, is that the end user need only RUN the Applesoft; it
isn't necessary to EXEC anything.

I'll look around and see if I can find examples of each method.

--Dave Althoff, Jr.
-- 
    /-\        _       _               __   |\                       
   /XXX\      /X\     /X\_      _     /XX\_ | \    
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\|(hard hat area...       )
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\(.sig under construction)