[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
simple BASIC problem
- Subject: simple BASIC problem
- From: jeff.brielmaier@yob.com (Jeff Brielmaier)
- Date: 1995/05/10
- Distribution: world
- Newsgroups: comp.sys.apple2
- Organization: Ye Olde Bailey BBS - Houston, TX - 713-520-1569
- References: <3oii8t$lms@acme.freenet.columbus.oh.us>
- Reply-to: jeff.brielmaier@yob.com (Jeff Brielmaier)
To: dmasters@freenet.columbus.oh.us
DM>I'm writing a little simple Applesoft BASIC loading program for a very
DM>large binary game. The problem is that the basic program starts at $801
DM>and goes to $B00. The binary program bloads also at $800 and stomps all
DM>over the basic program.
DM>
DM>Is there a way to relocate the basic program to another location. The
DM>binary file can't be loaded at another location.
I am going assume that BASIC program loads the binary program....
If so, make the first line of your BASIC program:
10 if peek (104)<>16 then poke 4096,0: poke 104,16: ?chr$(4)"run filename"
What this line does is:
1) if peek (104)<>16 Checks the address where the BASIC progam is loaded
at. The '16' represent a load address of $1001
[instead of $801].
2) poke 4096,0 Sets $1000 to "00"; Required of else AppleSoft will
be "upset".
3) poke 104,16 Changes the starting address of the Applesoft
program to $1001.
4) ?chr$(4)"run filename" Re-run your program. This will cause the file to
be loaded at the 'new' address ($1001). When the
1st instruction is run for the 2nd time, the IF
fails since location holds "16" and execution is
passed to the 2nd instruction (i.e. the rest of
your program
* KingQWK 1.05 # [PK] * Features should be discovered, not documented!
----
+------------------------------------------------------------------------+
|Ye Olde Bailey BBS Zyxel 713-520-1569(V.32bis) USR 713-520-9566(V.34/FC)|
| Houston,Texas yob.com Home of alt.cosuard |
+------------------------------------------------------------------------+