EasyManua.ls Logo

Commodore CBM - PET BASIC Interpreter

Commodore CBM
447 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...
PET BASIC INTERPRETER
The PET BASIC interpreter executes a user program by decoding each
source line stored
in
memory
in
a compacted form. When
vou
enter a line
from the keyboard, the PET Line Editor
has
control, allowing
vou
to
do
any
editing of the line until
vou
press the RETURN key. Program lines
are
stored in
memory in ascending line number order. When the
RETURN
key
is
struck. the
BASIC interpreter searches memory for the same line number. If there
is
one.
it
replaces the current line
with
the new line. If there isn't one. the next higher line
number
is
encountered. The BASIC interpreter then inserts the new line into
memory and moves the rest of the program
up.
Program lines are stored at the beginning of the user program
area
of memo-
ry.
which
starts at memory location 1024. Variables are stored in memory above
the program lines. and arrays
are
stored above the variables.
Ail
three areas begin
at lower addresses and build upwards to higher addresses. Strings are stored
beginning at the top of memory and
work
downwards. The BASIC interpreter
builds ail four areas. moving them
as
necessary and adjusting pointers for inser-
tions and deletions. Eight pairs of memory locations contain pointers to the divi-
sion points in the user program
area
of memory. These
are
shown in Figure 6-2.
(They
are
also listed in Table 6-2.)
The formats in
which
BASIC statements. variables. arrays. and strings are
stored
in
their respective areas
are
discussed next.
310

Table of Contents

Other manuals for Commodore CBM

Related product manuals