home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 23
/
023.d81
/
t.memgraph.bas
< prev
next >
Wrap
BASIC Source File
|
2022-08-26
|
3KB
|
182 lines
MEMGRAPH
by
R. Harold Droid
COMMODORE POWER/PLAY MAGAZINE
April/May, 1986
p.93
The hallmark of a good program is
its efficiency-- how well it makes
use of the computer's memory.
MEMGRAPH is a utility that shows a
graphic representation of how much
memory a program takes up and how it
uses that storage space.
To see how MEMGRAPH does this, we
must first remember that in the
Commodore 64, BASIC divides its
available space into five sections:
program text, variables, array
variables, free space, and string
space. MEMGRAPH shows the relative
amount of memory taken up by each of
these five sections.
The graph of this data is a grid of
blocks: each filled block represents
256 bytes. The type of information
represented by the block is shown by
its color. For example, 256 bytes of
program text will be repesented by
a certain color while other sections
are represented by other color codes.
Seeing the relationships between
these sections can tell you a great
deal about the efficiency of your
programs.
USING MEMGRAPH....
When MEMGRAPH is loaded, a machine
language file is created. Loading
this file changes the BASIC pointers,
so you must type NEW to reset them.
Then, entering SYS 51456 will
activate MEMGRAPH.
Pressing the SHIFT and RESTORE at
the same time will send you to the
graph screen. Pressing the SHIFT key
will return you to the previous
screen where you can load the program
you want graphed.
While you are running this program,
pressing SHIFT/RESTORE at any time
will return you to the graph screen.
If you return to the graph screen
before actually running the program,
only the program text blocks will be
filled.
When you press SHIFT/RESTORE after
running a program, you will see a
color coded repesentation of the
storage used by your program.
To deactivate MEMGRAPH, press the
RUN-STOP/RESTORE combination. If
there has been no power-down,
entering SYS 51456 will reactivate
it.
NOTE: The MEMGRAPH graph is designed
for use on a color monitor, thus it
does not look that good on a black
and white monitor.
You may, however, alter the program
for a black and white monitor. Load
and run MEMGRAPH.BAS to get a copy of
MEMGRAPH on the disk. Then load the
MEMGRAPH.MOD program and change the
data statements to change the color
of the graph so that it looks good on
your screen. After modifying the
program, run it and it will save a
copy of MEMGRAPH.B/W onto your disk.
This program will reflect only those
changes you have made.
For more information on the ins and
outs of MEMGRAPH, consult Droid's
article cited at the beginning of
this file.
FILES REQUIRED:
MEMGRAPH.BAS
----------<end of text>--------------