This chapter talks about how BASIC stores and manipulates data. The
topics include:
- A brief mention of the operating system components and functions
as well as the character set used in the Commodore 64.
- The formation of constants and variables. What types of variables
there are. And how constants and variables are stored in memory.
- The rules for arithmetic calculations, relationship tests, string
handling, and logical operations. Also included are the rules for
forming expressions, and the data conversions necessary when you're
using BASIC with mixed data types.
The Operating System is contained in the Read Only Memory (ROM) chips
and is a combination of three separate, but interrelated, program
modules.
- The BASIC Interpreter
- The KERNAL
- The Screen Editor
- The BASIC Interpreter is responsible for analyzing BASIC statement
syntax and for performing the required calculations and/or data
manipulation. The BASIC Interpreter has a vocabulary of 65
"keywords" which have special meanings. The upper and lower case
alphabet and the digits 0-9 are used to make both keywords and
variable names. Certain punctuation characters and special symbols
also have meanings for the Interpreter. Table 1-1 lists the special
characters and their uses.
- The KERNAL handles most of the interrupt level processing in the
system (for details on interrupt level processing, see Chapter 5).
The KERNAL also does the actual input and output of data.
- The Screen Editor controls the output to the video screen (television set) and the editing of BASIC program text. In addition, the
Screen Editor intercepts keyboard input so that it can decide
whether the characters put in should be acted upon immediately, or
passed on to the BASIC Interpreter.