EasyManua.ls Logo

Commodore VIC-20 - Page 239

Commodore VIC-20
404 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter
6:
Graphics 225
Locations
55
and
56
form a pointer
to
the end
of
BASIC memory. This
is
a l6-bit number that
is
the location
ofthe
byte after the last one available
for BASIC's use. Locations
51
and
52
are a similar pointer for BASIC's
string storage area.
Locations
51
and
55
will normally contain zero after a
CLR
or
a RUN
command,
and
need not be changed. To calculate the POKE value for
locations
52
and 56, divide the starting location for your character memory
area by
256.
It
is
essential
that
the POKEs to limit BASIC's memory be done before
any variables are defined in your program and that they be followed
by
a
CLR. Otherwise, BASIC may not recognize the limits you have attempted
to set.
Other software packages also "steal" memory from BASIC. Commo-
dore's Programmer's Aid and Superexpander cartridges are known to do
this.
It
is
probable
that
other packages, from Commodore as well as other
manufacturers, will also do so.
If
you intend
to
use custom characters with
these packages, you must "steal" the character memory area before they do.
For
programs like the Programmer's Aid cartridge, which are turned on
with a SYS command, POKE the value calculated above into locations
52
and
56
and type the CLR command before typing the SYS command.
Some programs do not honor the BASIC memory limits. The Pro-
grammer's Aid cartridge
is
one such program. These programs use the value
in location 644, which
is
not checked by BASIC, to determine the last byte of
memory in the VIC. This location can be POKEd with the same value used
for locations
52
and 56, but some caution
is
required, because you cannot
predict how future cartridges will use this location.
If
a program that "steals"
memory works without a particular cartridge, but fails when
that
cartridge
is
installed, this
is
probably causing the problem.
If
a
POKE
to location 644
is
required, it must be done
at
the same time as the POKEs to locations
52
and
56,
before the CLR.
Cartridges like the Superexpander that turn themselves on automati-
cally steal their memory before you can change the pointers. You must either
avoid using the area they have "stolen" (usually the highest
few
hundred
bytes
of
memory)
or
remove the cartridge when running programs that use
custom characters.

Other manuals for Commodore VIC-20

Related product manuals