Operating instructions

SYM·1 Staged Loading
Technique for Segmented
Programs
The gYM cassette tape
1/0
can not load continuously
from 0000
on. The end of page zero and the end of page
one can not be directly loaded. A program and technique
are presented which simply get around this situation.
Robert
A.
Peck
P.O. Box
2231
Sunnyvale, CA 94087
)
The basic
SYM-1
comes equipped
with IK
of
user RAM,
most
of
which can
be
used for program material. This RAM,
however, because
of
usage by the
system monitor, is not contained in a
continuous
block.
Specifically, the area from roughly
01
D1
to
01
FF is used as a
stack
area.
Any
data
or return addresses pushed on-
to the
stack
during program (or
monitor
routine) execution will erase and replace
any program material which one
might
attempt
to store in these locations.
Likewise the
SYM
manual indicates
that
the page zero
locations
from OOFO
to OOFF are used occasionally by the
monitor
program.
Using the
SYM
tape dump routines,
we are able
to
dump a continuous block
0000
to
03FF to the tape but
it
is not
possible
to
reload this block in the same
manner because
of
the
monitor
usage
of
the areas specified above.
In order to make as full use
of
the
memory space as possible then, we
must
segmentthe
programs, storing one
segment in the area from 0000 to OOfF,
another from 0100
to
01CF and the third
from 0200
to
03FF (or higher
if
additional
memory is installed).
January, 1980
To store the complete program on
tape, we must store the segments in-
dependently, since that is the only way
we
can properly retrieve them.
Just
as
an
example, let's say that the first segment
has an
10
byte
of
"02",
covering
OOOO-OOfF,
the second segment an
10
byte
of
"03"
(0100-01CF) and third an
ID
of
"04",
(extending from 0200 to the end
of
the program).
Then to reload the program from
tape, we must issue three sets
of
com-
mands, specifically: Load
02
(CR),
Load
03
(CR),
Load
04
(CR).
We
must
wait
for
the tape load in between entries. Then
we
must
issue the command which
starts
the program. If the start location
is 0200, we
must
enter: Go 200
(CR).
It would
be
much simpler
if
we were
able to enter all
of
the commands at
once and have the machine load all the
segments in the right places and then
to
auto-jump
to
the start
of
the program on
completion
of
the load.
Well there is an easy way
to
set this
up
with
the
SYM-1.
A
16-byte
program
entered by the user
into
any
16
con-
secutive locations will act as the
initial
loader program. This is shown in Figure
One.
MICRO
--
The 6502 Journal
This program would load a program
with an
ID equal to "01". Because we did
a jump
to
the tape load routine rather
than a
"JSR",
an interesting thing hap-
pens. When the tape load routine is done
it
executes an "RTS", a return from
subroutine. This causes the last
two
bytes pushed onto the stack to
be
pulled
back
off
and loaded
into
the program
counter.
Therefore when
we
complete the
load
of
program "01", we will execute a
jump
to location 0200 because this is the
two byte address we pushed onto the
stack before the tape load routine was
ordered. Program "01" is, in this case, in-
tended
to
be
loaded into
loctions
0200-0210
and is shown in Figure Two,
described below.
This program will load the segment
"02"
into
locations
O-CI,
then
"03"
into
locations 100-1C1, and finally segment
"04"
into
locations 0200-03FF. Note that
program segment
"04"
writes over the
area where program "01" was loaded.
However, since we were under control
of
the
monitor
program at the time, it did
not matter at all. Besides this, once the
third segment is fully loaded, we no
longer need the loader program in
memory.
20:59