Commodore PET User Manual page 327

Table of Contents

Advertisement

The operators (the symbols
+-*11 < = >
as weil as the words AND. OR. and
NOT) are given keyword codes (high-order bit set) since they "drive" the BASIC
interpreter just as reserved words do (e.g.. 179 for <). The standard ASCII codes
for these symbols (e.g.. 60 for <) appear only in the text of a string.
Spaces in the source line are stored except for the space between the line
number and first keyword. This space is supplied on LISTing when a stored state-
ment is expanded to its original form. Vou can conserve memory storage space
by eliminating blanks (but this makes the program harder to read). Vou can
also conserve space by putting more than one statement on a line, since the
five bytes of link, line number, and 0 end byte are stored only once.
The size of each statement is variable and is terminated by a byte of
zero to indicate the end of the statement. (A value of zero anywhere within the
text is stored as 48.) Zero byte flags are used by the BASIC interpreter in execut-
ing a program when it goes through the compressed BASIC text from left to right
picking out keywords and performing the indicated operations. A zero byte indi-
cates the end of the statement; the next four bytes are the link and the line num-
ber of the next statement. In contrast to searching through the text and using 0
byte indicators to locate the next statement. links are used when searching the
statements for their line numbers. Three consecutive bytes of zero (the la st state-
ment's 0 byte followed by two zero link bytes) flag the end of text when executing
the program.
A program is stored onto cassette tape in the same format as shown in
Figure 6-3 for memory storage. Thus. it is basically "dumped" ante tape in a
continuous block. including link addresses and 0 end bytes.
The use of tokens in place of keywords is not unique to the PET. but there is
no standard coding from one interpreter to another. Thus. a BASIC source pro-
gram SAVEd on tape by PET BASIC is not compatible with other BASICs, nor
can BASIC programs generated on other (non-PET) machines normally be
loaded by the PET BASIC interpreter.
314

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cbm

Table of Contents