Instruction manual

Applesoft Program Relocation
George
S.
Guild, Jr.
117 Cardinal Drive
Hampton,
VA
23664
Here is a simple technique
to
change the program
storage space when using Applesoft.
Do
not set the program pointer lower
than
$801
for
ROM
Applesoft
or
$3001
for
RAM
Applesoft because doing so will
either interfere With the text screen area
($400
to
$800) or overwrite the
RAM
inter-
preter which is stored at $800 to $2FFF.
)
Integer BASIC has commands to set
boundaries for both the program upper
limit (HIMEM) and
data
lower
limit
(LOMEM). This gives Integer BASIC
users total freedom to protect areas
of
memory for HIRES graphics and/or
machine
language subroutines. Ap-
plesoft however, uses
fixed
program
storage, and uses HIMEM and LOMEM
only to set the upper and lower boun-
daries
of
stored data. This lack
of
flex-
ibility
can result in problems when using
Applesoft.
For example,
RAM
Applesoft users
were forever limited
to
4K
of
program
space, when they wanted to use HIRES
graphics, even
if
48K
of
memory was
available. Setting LOMEM
to
$6000
(24576)
preserves all
4K
for programming
with
data
saved above the HIRES page
2.
Users
of
the
Heuristics Speechlab have
found
that
the firmware stores
its
data
starting at $800
(2048).
This
data
would
overwrite any BASIC program created
by
the
ROM
Applesoft, limiting
its
use to InĀ·
teger BASIC.
The sequence
of
commands shown
in
the insert allows Applesoft users to
overcome this limitation. First decide
where you want your program
to
start,
Le.
the lowest address
of
the program.
For example,
if
you want
to
use the
memory space above HIRES page
2,
this
address
would
be $6000
(24576)
for the
start
of
program storage. Store
$00
to
the first three bytes here and then set
the program pointer
($67,
68)
to
the star-
ting address plus one.
Programs loaded will now
start
at
$6000 until you reset the pointer
or
reload/reinvoke
Applesoft.
CLEAR,
NEW, LOAD, and
RESET
do not affect
this pointer. Change the
start
address
and
program
pointer
for
your
re-
quirements.
]SAVE
]"Reset"
*6000:0000
00
*67:01
60
*3DOG
]NEW
]LOAD
Users
of
DOS
versions earlier than
DOS
3.2
may have
to
execute a CALL
3314,
for disk Applesoft, or a CALL
54514,
for
ROM
Applesoft, in order to up-
date programs loaded from disk.
DOS
3.2
does the required CALL automatical-
ly. Cassette systems have no such pro-
blem.
If
the program you wish
to
relocate is in memory you
must save
it
first.
Enter monitor.
Store zeroes at beginning
of
new program space.
If
omitted, strange syntax
er-
rors occur.
Set program pointer to new
start address
piUS
one.
Note that pointer is stored
in low byte first, then high
byte, as usual for
6502
microprocessor.
Disk
system
return
to
BASIC.
(Cassette
system/ROM
Applesoft:
Control-B; RAM Applesoft:
OG)
Initialize
Applesoft
Program
will
be loaded
starting
at
address $6000.
December, 1979
MICRO
--
The
6502
Journal
19:49