Commodore 2001-8 User Manual page 30

Table of Contents

Advertisement

machine;.. the" worst that can happen Is that you clear the screen accidently after typing in a bunch of
stuff.
REVERSE FIELD
We have shown in the examples of quote mode and insert how once a mode has been established for a
line, the PET will continue with that function until it is either cancelled by a new control character or a
carriage return. Reverse field works in the same way. It remains in effect until a reverse field off character
is typed or a carriage return is entered.
As described in a previous section on screen memory, reverse field characters are stored with a special
bit on to indicate the black spots in the characters coming from ROM will be all white and all the white
spots will be black. As you will see when you type an example, this gives a very desirable highlighting
effect and doubles the number of potential characters which the PET can display. This feature is so
useful that it is not only implemented on the PET display but in some of the PET hard copy printers
as well.
Here is an example of how reverse field works: Clear the screen and type
HI
(space). Next hit reverse
field on and type
TH ERE
.Finally type reverse field off, (shifted reverse field on), type (space),
PET.
This gives us a line in which we have highlighted THERE.
Reverse field remains on from the first time the control character is typed and alt characters
subsequently typed on the screen will be printed in reverse field until the mode is terminated as we
previously mentioned. This applies equally to keyboard input as well as characters printed from a literal
string.
To get the PET to type out in reverse field we use a literal with the control character for reverse-field-on
inserted. TYPE ?"HI (reverse field on) THERE (reverse field off) PET". Note that the reverse field on and off
characters occupy a space on the screen when programming and that they appear in reverse field, but the
THERE is not in reverse field yet. The effect of the quote is to postpone the action of a control character
until the titeral is interpreted. Since the reverse field is turned on by setting a bit of each character in
screen memory, a screen position is not required for reverse field on or off when the stream of characters
is received by the program which prints it on the screen. Reverse field remains on until a reverse field off
character or a carriage return is typed.
TERMS AND OPERATORS
The communication with BASIC is either with numbers or with alphanumeric literals. Numbers are always
presented in decimal form even though the microprocessor in the PET operates in binary mode. In order
to keep the two straight, PET will assume that whenever we are talking about a number, we are
representing it in decimal form. Later when we talk about hexadecimal numbers, they will always be
preceded by a $··e.g. $0010 is equal to 16.
As BASIC recieves Jines, the interpreter divides the characters it sees into several classes. Such as
commands, functions and operators. PRINT is a command to BASIC with a specific function that PET can
perform.
A function can be something like square root or a variable, or a special function. Whenever you type non
the keyboard, you get a constant of 3.14159265, which can be used in an expression.
An operator is a character that is interpreted by BASIC as an arithmetic function which is to be performed
in evaluating an expression. The following set of operators are defined for BASIC:
Plus sign (+) causes two values to be added together using floating point representation with the results
26

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pet 2001-8

Table of Contents