Technical Systems Consultants, Inc. P.O. Box 2570 West Lafayette, Indiana 47906 All Rights Reserved
Technical Systems Consultants, Inc. P.O. Box 2570 West Lafayette, Indiana 47906 All Rights Reserved
This entire manual is provided for the personal use and enjoyment of the purchaser. Its
contents are copyrighted by Technical Systems Consultants, Inc., and reproduction, in
whole or in part, by any means is prohibited. Use of this program, or any part thereof,
for any purpose other than single end use by the purchaser is prohibited.
DISCLAlMER
The supplied software is intended for use only as described in this manual. Use of
undocumented features or parameters may cause unpredictable results for which Technical
Systems Consultants, Inc. cannot assume responsibility. Although every effort has been
made to make the supplied software and its documentation as accurate and functional as
possible, Technical Systems Consultants, Inc. will not assume responsibility for any
damages incurred or generated by such material. Technical Systems Consultants, inc.
reserves the right to make changes in such material at any time without notice.
CONTENTS
PAGE
1. INTRODUCTION 3
2. DEFINITIONS 4
3. CONVENTIONS 5
4. FUNDAMENTALS OF BASIC 5
4.1 Lines 5
4.2 Constants 6
4.3 Variables 7
4.4 Dimensioning 7
4.5 Assignment 8
4.6 Operators 9
4.6.1 Mathematical Operators 10
4.6.2 Logical Operators 10
4.6.3 Relational Operators 12
4.6.4 String Operators 12
4.6.5 Operator Precedence 13
4.7 Mode 13
4.8 Remarks 14
5. COMMANDS 15
6. STATEMENTS 18
6.1 Assignment 18
6.2 Transfer of Control 20
6.3 Conditional 22
6.4 Input/Output 24
6.6 Loops 25
6.6 Termination 28
6.7 Miscellaneous 29
7. SUPPLIED FUNCTIONS 32
7.1 Mathematical 33
7.2 Trigonometric 34
7.3 Character 35
7.4 Input/Output 37
7.5 Miscellaneous 38
9. ERROR HANDLING 47
9.1 The ON ERROR Statement 47
9.2 The RESUME Statement 48
9.3 ERR and ERL Variables 48
9.4 Disabling ON ERROR 49
9.5 Error Handling Examples 49
14. RENUMBER 72
-2-
TSC BASIC User's Manual
1. INTRODUCTION
TSC BASIC is a very fast and complete BASIC. It is used like most
BASIC interpreters in that lines are entered from the keyboard to build
the program and the resulting program may be run at anytime by using the
RUN command. It contains all of the normal interactive features of
BASIC including a direct execution mode which allows BASIC to be used as
a calculator.
All lines entered into a BASIC program must begin with a line
number. All lines are automatically put in numerical sequence which
allows for simple editing. Lines which already exist in a program may
be deleted by simply typing the line number of the line followed by a
carriage return. It is recommended that the user read this entire
manual before attempting to use TSC BASIC. It is assumed that the
reader is familiar with BASIC programming, so detailed programming
examples are not given.
-3-
TSC BASIC User's Manual
2. DEFINITIONS
b. LINE In BASIC, each line begins with a line number and ends
with a carriage return. A line may contain only a
single statement or may consist of several statements
separated by colons (:) or backslashes (\).
-4-
TSC BASIC User's Manual
3. CONVENTIONS
<essential element>
[optional element]
4. FUNDAMENTALS OF BASIC
4.1 Lines
Each line of a BASIC program begins with a LINE NUMBER. The line
may contain one or more statements separated by colons or backslashes
and is terminated by a CARRIAGE RETURN. The length of a line can not
exceed 127 characters. Lines may be numbered from 1 through 32767 and
each one must have a unique number. When a program is executed by
BASIC, it starts with the smallest line number and progresses toward the
largest.
spaces: 30 X=32*X/3+7.3*X/2+6.54*X-.1
40 X = 32*X/3 + 7.3*X/2 + 6.54*X -.1
multiple
statements
on a line: 120 INPUT "SPEED,TIME";S,T:D=S*T:PRINT "DIST=";D
300 A=310*X : B=K-A:C=A*2.9/11:PRINT "CF=";A;B;C
-5-
TSC BASIC User's Manual
4.2 Constants
A floating point number can be entered into the computer in the form
that you would normally write or type it. It may be a simple string of
decimal digits (an integer) or it may have a decimal point appearing
somewhere (a decimal digit). Since internal representation of numbers
in this form is only possible over a limited range, BASIC is forced to
convert very large or small numbers to scientific notation.
-6-
TSC BASIC User's Manual
4.3 Variables
4.4 Dimensioning
-7-
TSC BASIC User's Manual
They may be used in program operations just as they are written above or
the "subscript" could be a variable such as X(A) where "A" has an
integer value of 0, 1, 2, 3, or 4. The subscript could also be an
expression such as X(A+2). When this is encountered in a program, the
subscript expression is evaluated using the current value of "A". BASIC
will also support two-dimensional arrays. A two-dimensional array
defined by the statement:
30 DIM X(3,2)
specifies a four by three element matrix. This matrix has the following
elements:
4.5 Assignment
Most variables are assigned numeric or string values using the LET
statement. For example the statement:
10 LET X=2
240 INPUT P1
causes the computer to print a question mark and then wait for the user
to type in something. The data the user types will be assigned to the
variable P1. READ and DATA statements must be used together. Briefly,
a READ statement such as:
-8-
TSC BASIC User's Manual
100 READ K
4.6 Operators
The second class is the Logical Operators. They are used to perform
bit by bit operations on integer quantities and are used extensively in
conditional tests and for things such as masking. Since they operate on
integer quantities the internal "real" representation (floating point or
scientific notation) must first be converted to integer. The operation
can now be performed and then the number is converted back to its "real"
representation. All of these conversions are done automatically by the
BASIC interpreter.
-9-
TSC BASIC User's Manual
MATHEMATICAL OPERATORS:
1. Exponentiation
2. Unary Minus
3. Multiplication and Division
4. Addition and Subtraction
When Logical Operators are used on one or two numbers they form the
desired operation on corresponding bits of the number or numbers. If,
for example, we assume A and B are equal to the following binary
quantities:
A=(110O1O111111O110)
B=(O111O1O1111OO1OO)
Then:
NOT A =(OO11O1OOOOOO1OO1)
-10-
TSC BASIC User's Manual
A AND B=(0100000111100100)
A OR B =(1111111111110110)
The logical operators have a totally different effect when they are
used in an expression that is the test condition of an IF-THEN
statement. In this case the expression is being logically evaluated (not
arithmetically evaluated) to see if it is true or false. An expression
that is evaluated and determined to be true has a numerical value of
"-1" and one that is determined to be false has a value of "0". A
statement such as:
LOGICAL OPERATORS:
-11-
TSC BASIC User's Manual
RELATIONAL OPERATORS:
= X=Y X is equal to Y
<> X<>Y X is not equal to Y
< X<Y X is less than Y
> X>Y X is greater that Y
<= X<=Y X is less than or equal to Y
>= X>=Y X is greater than or equal to Y
-12-
TSC BASIC User's Manual
4.7 Mode
There are two different modes in which BASIC can function. The one
referenced most often to this point is that in which you use the RUN
command to execute a program that has been typed in. The other mode is
the Immediate Mode. In the Immediate Mode you can type in a command or
statement without a line number and the computer will immediately
execute it. In contrast to this, the normal running of a program starts
at the statement with the smallest line number and progresses, executing
statements, toward the largest numbered statement. BASIC distinguishes
between these two types simply by the presence or absence of a line
number. So, for instance, if you had typed in the statement:
nothing would happen after you hit the carriage return. This is because
BASIC assumes that this is part of a program you are writing and it will
save and execute it only in response to a RUN command. If, on the other
hand, you type:
PRINT "Monday"
-13-
TSC BASIC User's Manual
4.8 Remarks
-14-
TSC BASIC User's Manual
5. COMMANDS
CLEAR CLEAR
CONT CONT
-15-
TSC BASIC User's Manual
EXIT EXIT
FLEX FLEX
The LOAD command is used to load a text type file into BASIC
from disk. The file name should be in quotes and in the
standard FLEX form (drive.name.ext). The name defaults to
the working drive and to a BAS (BAsic Source) extension.
Standard FLEX text files (such as from the TSC Editor) may
be loaded.
NEW NEW
-16-
TSC BASIC User's Manual
RUN RUN
TRON TRON
+ +RENUMBER
The "+" command tells BASIC to send the rest of the command
line to FLEX. This is a dangerous command in that some FLEX
utilities load in the same area of memory as BASIC. If a
FLEX utility is executed from BASIC in this way, be certain
that the utility loads into the utility command space in
FLEX. The main use for this command is to invoke the
RENUMBER utility which is supplied with BASIC. This utility
loads into the utility command space in FLEX and will
renumber BASIC programs in memory. See the section titled
RENUMBER for more details.
-17-
TSC BASIC User's Manual
6. STATEMENTS
All the BASIC statements listed below are arranged in groups that
have similar functions or purposes. Appearing to the right of each
statement is an expression showing its complete usage. This will be
followed by one or more examples to demonstrate a typical use. Then,
last of all, the definition and explanation of the statement appears.
6.1 Assignment
50 DATA -3.556E-5,O,2,4.59E11
60 DATA APRIL, MAY, THATS ALL
70 DATA " 100"," 1OOO","1O,OOO"
10 LET X=3.5
25 LET H1=27.2*H1/(5.4E7-X)
70 LET DA$="MONDAY"
75 LET X(5,J)=O (dimensioned variable)
80 Y=12.314 (implied LET)
-18-
TSC BASIC User's Manual
440 RESTORE
-19-
TSC BASIC User's Manual
5 GOSUB 250
100 GOTO 50
20 ON I GOSUB 30,40,50,60
-20-
TSC BASIC User's Manual
RESUME 100
34 RETURN
-21-
TSC BASIC User's Manual
6.3 Conditional
30 IF A+B=1O THEN 50
80 IF A=O THEN PRINT "A=O"
99 IF X=Y THEN IF X>Z GOTO 40
IF THEN ELSE <line #> IF <expr> THEN <line #> ELSE <line #>
<stment> <stment>
-22-
TSC BASIC User's Manual
-23-
TSC BASIC User's Manual
6.4 Input/Output
10 INPUT LINE A$
20 INPUT LINE B1$(5)
-24-
TSC BASIC User's Manual
BASIC divides each output line into 5 fields with each field
containing 16 character positions. When arguments are
separated by commas, the comma after one item will cause the
printer to jump to the beginning of the next field before
printing the next value or string. Thus, a comma will cause
the printer to jump to column 16, 32, 48 or 64, depending on
the current location of the printer. If the printer is
already at column 64 or beyond, then the printer or CRT will
do a carriage return/line feed and print the data in column
1 of the next line. You can type two or more commas next to
each other. This will cause the printer to skip one field
just as three commas would cause two fields to be skipped
and so on.
-25-
TSC BASIC User's Manual
6.5 Loops
When BASIC executes a FOR statement, this will cause all the
following instructions to be executed until a NEXT is
reached. Execution then loops back to the FOR and if the
condition specified in the FOR is true, then the statements
will all be executed again. Once more control loops back to
the FOR, and this cycle continues until the test finally
fails, at which time execution resumes following the NEXT
statement. The "variable" in the FOR statement is used to
keep track of how many trips or loops have been made through
the FOR-NEXT statements. The variable is initially assigned
the value of "expr 1" and each time the NEXT statement loops
back to the FOR statement, "expr 3" is added to the current
value of the variable. Since "expr 3" can be positive or
negative, this can have the effect of incrementing or
decrementing the value of the variable. If no STEP is
specified, then a value of positive one is assumed. When no
step is specified (+1 assumed), or when a positive step is
given, then the test that is specified in the FOR statement
is determined to be true as long as the value of the
variable is not greater than that of "expr 2". When a
negative step is specified, the test yields true as long as
the variable is not less than "expr 2". Once again, the
statements between a FOR and NEXT will always be executed a
first time but subsequent executions only occur while the
index variable in the FOR statement is within the bounds of
"expr 2".
-26-
TSC BASIC User's Manual
10 FOR I=1 TO 10
20 PRINT "X" (print 10 X's)
30 NEXT I
-27-
TSC BASIC User's Manual
6.6 Termination
300 END
50 STOP
STOP AT LINE 50
-28-
TSC BASIC User's Manual
6.7 Miscellaneous
The user can define single line functions with the DEF
statement. The function is defined (understood by the
computer) as soon as the DEF statement has been executed.
The same function may be redefined at any time in the
program because only the most recent definition is used.
The defined function may contain only one argument. The
dummy variable used to represent this argument is local to
the function definition and has no other meaning to the
program.
Now suppose the definition has already been executed and the
following two lines of code are executed:
300 X=3
310 Y=100+FNTT(X)
-29-
TSC BASIC User's Manual
DIM <line number> DIM <variable 1> (n) [,<variable 2> (m),.. ]
(k,l) (m,n)
20 DIM X(20),Y(30),Z(30,40)
-30-
TSC BASIC User's Manual
-31-
TSC BASIC User's Manual
7. SUPPLIED FUNCTIONS
100 Y=SQR(9)
is executed, Y will have a value of three since SQR is the Square Root
function.
-32-
TSC BASIC User's Manual
7.1 Mathematical
FUNCTION DEFINITION
__________ __________________________________________________
LOG(X) This is the natural logarithm (to the base "e") of the
number X. This is the only logarithm supplied with
BASIC, but it is the only one needed because logarithms
to any other base can be calculated from it. The
following formula is used to translate to logarithms of
other bases where the LOG to the base B is desired.
SQR(X) The Square Root function returns the square root of the
argument X. If the argument is negative, error message
107 will be issued.
-33-
TSC BASIC User's Manual
7.2 Trigonometric
FUNCTION DEFINITION
__________ __________________________________________________
-34-
TSC BASIC User's Manual
7.3 Character
FUNCTION DEFINITION
__________ __________________________________________________
-35-
TSC BASIC User's Manual
-36-
TSC BASIC User's Manual
7.4 Input/Output
FUNCTION DEFINITION
__________ __________________________________________________
-37-
TSC BASIC User's Manual
7.5 Miscellaneous
FUNCTION DEFINITION
__________ __________________________________________________
PTR(var name) The PTR function returns the address of the variable named
as the argument. If the variable is a floating point
type, the address returned will be the actual storage
location of the number. Floating point numbers are
stored as four bytes, the first three being the mantissa
(sign plus magnitude, with the sign in the most
significant bit position) and the last byte is the
exponent (base 2, biased by hex 80). The mantissa is
kept in hidden bit, normalized form.
-38-
TSC BASIC User's Manual
Random Number=(ML-MS)*RND(O)+MS
-39-
TSC BASIC User's Manual
Before any file may be used in BASIC, it must first be opened. The
OPEN statement is used for this purpose. For sequential file
manipulations, there are two forms of the OPEN statement. The syntax is
as follows:
Examples:
The OPEN OLD statement will open the file specified in the string
expression for read. The defaults are the working drive and DAT for the
extension. The AS clause tells BASIC which I/O channel to use for the
file I/O. The file channel may be 1 to 12, which means there is a limit
of 12 open files at any one time (memory permitting). If the file is
not found, an error will result (error #4). This error may be handled
by using ON ERROR GOTO. Once opened, the file is ready for reading.
The first example will open the file "TEST.DAT" on the working drive on
channel I for read.
The OPEN NEW statement is used for creating a new file and preparing
it for writing. The file specified in the string expression will be
created if it does not already exist. If it does exist, the original
file WILL BE DELETED and a new file with the same name will be created!
The defaults for the file name are as in OPEN OLD. The second example
above will open the file whose name is contained in the string variable
A$ for write. The I/O channel used will be the value of the variable F.
It should be noted that the OPEN statement will not actually open
the file on the disk, but will only make the preparations to do an open
file operation. Only when actual file I/O is required will the file
truly be opened on the disk. This implies that an OPEN OLD statement
which tries to open a non-existent file will not generate an error, but
when actual input is attempted, the error #4 will be generated.
-40-
TSC BASIC User's Manual
The above lines create a new file called "TESTFILE.DAT" on the working
drive. Internal channel number 3 is used. The resultant file will have
two lines, the first will be THIS IS A TEST FILE and the second will be
THIS IS THE SECOND LINE.
The file that is created is a pure text file and may be edited, listed,
etc. with any of the standard FLEX utilities. Listing the file
SQUARES.DAT created above would display the following:
1 1
2 4
3 9
4 16
5 25
Notice that since commas were used in the PRINT statements, the
resultant lines have the numbers spaced accordingly.
-41-
TSC BASIC User's Manual
Like the PRINT statement, the INPUT statement may also communicate
with a file. The INPUT syntax is:
This will cause the variables A and B to be read from the disk file
NUMBERS.DAT on the working drive. The file must provide ASCII data
exactly as it would be typed if the input were coming from the terminal.
Since two variables need data, the numbers in the file must be separated
by a comma and terminated by a carriage return, or both may be
terminated by a carriage return. If a file is being created to be read
later by an input statement such as shown above, commas need to be
manually inserted in the data file between the data items. For example:
-42-
TSC BASIC User's Manual
The expression indicated should have the same value as that used in the
OPEN statement for the file and indicates the internal channel number of
the file to close. Any number of files may be closed with one CLOSE
statement. Some examples will demonstrate its use.
200 CLOSE 3
520 CLOSE 1,6
Line 200 will close the file on I/O channel 3 and line 520 will close
the files open on channel 1 and channel 6. An error will result if the
file had not been previously opened.
10 INPUT #0, B$
will request input from the terminal just as a normal INPUT statement,
but no question mark prompt is output. After entering the data and
typing the return key, a carriage return line feed will not be echoed as
is done with the standard INPUT. This mechanism will allow precise
cursor control in programs requiring fancy input prompts. Remember that
files may not be opened for input on channel 0, but referencing channel
0 in an INPUT statement is allowed for the above stated purpose.
-43-
TSC BASIC User's Manual
will print THIS IS A TEST on the terminal, exactly as if the "#0," were
not present.
10 OPEN "O.PRINT" AS 0
20 FOR I=1 TO 10
30 PRINT #0, I, SQR(I)
40 NEXT I
50 CLOSE 0
Line 10 tells BASIC to read in the file PRINT.SYS (SYS is the default
extension when channel 0 is referenced). Notice that it was not
necessary to say OPEN OLD. The PRINT.SYS file format is described in
the FLEX User's and Advanced Programmer's Manual. Once the PRINT.SYS
file has been read, all output through PRINT #0 statements will use the
driver routines which are contained in the print file loaded. If the
PRINT.SYS contained drivers to output to a parallel printer port on port
7, then the output from the above sample program would have gone to that
printer. All output with PRINT statements not containing the #0 would
still go to the terminal. The CLOSE 0 statement would tell BASIC to
send all PRINT #0 output data back to the terminal again until another
OPEN AS 0 statement is executed.
One last example will demonstrate the print to channel 0 use. This
program allows output to be sent to either the terminal or the printer
by user request.
-44-
TSC BASIC User's Manual
where the string expression is used as the file name to be deleted. The
default extension is BAS and the default drive is the working drive.
This statement may also be used in the immediate mode. There is no
prompting with this command as in the FLEX delete command, so caution is
advised An example will demonstrate its use.
This line will delete the file named LEDGER.BAS from the working drive.
Again, there is no prompt with this delete so be careful!
where the first expression specifies the name of the file to be renamed
and the second expression is the new name it will have. The name
defaults to a BAS extension and to the working drive. As an example:
This line will rename the file TEST.BAS on the working drive to
OLDTEST.BAS. If TEST does not exist, an error #4 will be issued.
-45-
TSC BASIC User's Manual
The file name referenced by the string expression will be loaded and
executed. The name will default to the working drive and BAC (compiled
form) extension. The second optional expression designates the line
number at which the program should be started. Without the line number
specification, the program will begin execution at the lowest numbered
line, just as with the RUN command. An example will demonstrate:
This line will cause the file named BALANCE2.BAC to be loaded and run
starting at line 100.
-46-
TSC BASIC User's Manual
9. ERROR HANDLING
There are two classes of errors which can happen while executing a
BASIC program. The first class consists of I/O errors, both disk and
terminal related, while the second class deals with computational and
syntax type errors. The complete list of error numbers and their
respective meanings are in a following section. The error numbers
between 1 and 49 are all I/O type errors while 50 and above fall into
the second class. It should be noted that error numbers 1 through 28
are disk errors and are the same as those generated by FLEX. Normally
BASIC will print the error number as the error occurs and the program
will come to a halt. Many times it is desirable to continue execution
of a program after an error occurs, especially if the error is I/O
related. The ON ERROR statement is used for this situation and may be
used to control the result of any I/O related error.
This statement should be placed in the program before any lines which
may cause an I/O error for which the error routine deals. If an error
does occur, control will be transfered to the line number specified in
the ON ERROR statement. The system variables ERR and ERL will also be
set to the value of the error number and to the line number which caused
the error. More about these variables to follow.
-47-
TSC BASIC User's Manual
The RESUME statement is used to pass control back to the main BASIC
program after the error handling routine has completed. During program
execution, if an I/O error occurs, and an ON ERROR statement has been
executed, BASIC will go to the first line of the error handling routine.
When the error routine is finished it must pass control back to the main
program, the function of RESUME. The syntax for the RESUME statement
is:
If a line number is specified after RESUME, BASIC will restart the main
program execution at that line. If no line is specified (or 0 is
specified), BASIC will resume by re-executing the line which caused the
error. If this second method is used, note that the entire line will be
re-executed, and not just the statement which caused the error. Thus,
if the offending statement was not the first statement on the line, the
preceeding statements on that line will also be repeated. Two examples
follow:
1000 RESUME
2000 RESUME 200
The first example will restart the main program on the line which caused
the error (this is equivalent to RESUME 0). Line 2000 would cause the
program to resume at line 200. A RESUME statement should always be
included in error handling routines. No other form of return is valid.
When any error occurs, the two variables named ERR and ERL are
updated. The ERR variable will contain the error number and ERL will
contain the line number of the line which was executing at the time the
error happened. These variables may not be set by the user but may be
read at anytime. As an example:
This line will cause BASIC to print NO SUCH FILE if the last error was
an error number 4. The variable ERL is used in a similar manner. It
should be noted that programs using the ERL variable may need alteration
after a RENUMBER operation since the line referenced may change!
-48-
TSC BASIC User's Manual
Many times there are only sections of a program which require a user
supplied error routine. It is possible to disable the ON ERROR feature
once it has been disabled by using one of the following:
The ON ERROR GOTO 0 statement may also be placed inside a user error
handling routine. If BASIC comes across an ON ERROR GOTO 0 statement
while executing a users error routine, the user routine immediately
exits, and BASIC will print the error number on the terminal, just as if
the user routine had never been activated.
Line 10 tells BASIC where the error routine is located (line 1000).
When the INPUT statement is executed on line 20, it expects numeric data
only to be input. If the user enters a letter instead of a number,
BASIC would normally stop and print ERROR #30 AT LINE 20 at the
terminal. Since the ON ERROR statement has been executed, BASIC would
transfer control to line 1000 if an error occured. Line 1000 checks to
see if the error is number 30. If ERR is not 30, the ON ERROR GOTO 0 is
executed which disables the error handling routine and causes BASIC to
print the error number on the terminal and stop. If it is error 30, the
message on line 1010 is printed. Line 1020 will cause the program to
resume execution at the line which caused the error (line 20), and the
input prompt will be reissued.
-49-
TSC BASIC User's Manual
After the file name is input on line 10 the error routine is identified
to BASIC in line 20. Line 30 opens the file for sequential input on
internal channel 1. Lines 40 and 50 read the file a line at a time and
prints each line at the terminal. Eventually the end of the file will
be reached and an error will occur at line 40 from attempting to read
past the end of the file. At this time control will be passed to line
1000 which tests to see if the error was an error number 8 (end of
file). If it is, then the program is resumed at line 100 which closes
the file and ends the program. If the error was not 8, then the error
number will be printed and the program stopped.
-50-
TSC BASIC User's Manual
The EXEC statement is used to execute any FLEX utility which loads
into the FLEX utility command space ($A10O). Its syntax is:
The simplest form of random file I/O is called virtual arrays. The
virtual array mechanism allows the user to specify that a data array be
stored on a disk file rather than in memory. The two advantages of this
feature are that the array may be much larger than what would fit in the
available memory and that the data in the array remains after program
execution and may be used at a later date from another program. Virtual
array data is referenced exactly like standard array data which makes
the mechanism quite powerful and easy to use!
-51-
TSC BASIC User's Manual
The sequential I/O methods previously described only allow the next
sequential data item to be accessed or stored at any one time. The
virtual array storage method allows a random data item to be accessed or
stored, no matter where in the file the item resides. Before a data
matrix can exist in a virtual array, the array must be declared using a
special form of the DIM statement. Its syntax is:
For the most part, virtual array and standard memory array
manipulations are identical. One difference is in the way string
storage is performed. In a standard type string array, the data items
may be any length and change in size as the program executes. A virtual
string array requires each string in the array to have the same length.
The maximum length allowed is 252 characters but may be defined to be
anywhere from 1 to 252. Each string element stored into a virtual array
will either have enough spaces attached to the right side of the string
to make it equal in length to the defined string size (if it is shorter
than the defined length), or it will be truncated from the right if it
is longer than the defined length. To define the string length for a
particular virtual string array, the following form should be used.
Example:
The equals sign and expression define the string length to be used.
Again, the maximum length is 252 characters. The example defines the
virtual string array A$, which has 101 elements (including the 0
element), each of which are 63 characters in length. If a string length
is not specified in the DIM statement, a default length of 18 is used.
-52-
TSC BASIC User's Manual
The length of a virtual string array data item can greatly affect
the efficiency of data storage in a disk file. The system requires that
a string be completely contained in one disk sector and that the string
may not cross a sector boundary (thus the limit of 252 since there are
252 bytes of storage available in one sector). To avoid wasting disk
space, the defined string length should be an even divisor of 252. A
few examples will demonstrate this.
The OPEN OLD statement tells BASIC to search for a file which
already exists (an "old" file). If the file is not found, an error
number 4 will be issued. As an example:
will cause BASIC to search the working drive (by default) for the file
named TEST.DAT. DAT is the default extension. Either of the defaults
may be over-ridden, just as any FLEX file specification. If the file is
not found, error 4 will be generated.
-53-
TSC BASIC User's Manual
The OPEN NEW statement tells BASIC to create a "new" file. If the
file name specified already exists, IT WILL BE DELETED, and a new file
of the same name will be created. If the file does not exist, it will
be created. As an example:
Finally, the OPEN statement, without the NEW or OLD modifier will
first attempt to open an existing file (just like OPEN OLD). If the
file name is not found, one will be created and no error will be issued.
10 OPEN "NAMES" AS 1
This line would cause BASIC to first search for a file named NAMES.DAT
on the working drive (the above stated file name defaults apply). If
the file is found it is opened. If the file is not found, one is
created with the specified name.
Before a virtual array may be used, the corresponding disk file must
be opened using the OPEN statement described above, and the array must
be defined using the special DIM statement. Once this has been done,
the virtual array may be used in assignments and expressions exactly
like any standard array with one exception. There may only be one
virtual array reference in an expression. A short example will
demonstrate virtual array use.
10 OPEN "TESTFILE" AS 1
20 DIM #1, A(10O)
30 INPUT "TYPE ARRAY ELEMENT, NEW VALUE",E,V
40 PRINT "THE CURRENT VALUE IS";A(E)
50 A(E)=V
60 PRINT "THE NEW VALUE IS";A(E)
70 CLOSE 1
80 END
Line 10 opens the file named TESTFILE.DAT on the working drive. If the
file does not already exist, one will be created (because of the type of
OPEN statement used). Line 20 defines the virtual array A which is a
-54-
TSC BASIC User's Manual
floating point array containing 101 elements (counting element 0). From
this point on, the program treats the array A just as if it were a
standard array. Line 30 requests which element in the array is to
receive a new value and what that value should be. Line 40 prints the
current value of that data item, line 50 gives it the new value, and
line 60 prints the new value of the selected array item. Notice that
the array reference is purely random, and that it was not necessary to
access the file sequentially. Line 70 closes the file (as is necessary
after completing use of any disk file). The file TESTFILE now exists on
the disk with the selected data item altered to reflect its new value.
Program #1 Program #2
The two programs are identical except for line 50. In program 1 line 50
accesses the array by row (the row index advances the slowest) while in
program 2 line 50 accesses the array by column (the column index
advances the slowest). Program 1 will run much faster since it is
progressing through the file sequentially, while program 2 is having to
randomly thrash about the file which makes it run slower.
-55-
TSC BASIC User's Manual
will cause an error 24 at line 30 since a new file was just created and
no data existed at the element referenced. To make this program run
without an error, it is necessary to extend the file before the
reference is made.
-56-
TSC BASIC User's Manual
The basic idea behind record I/O is that data is stored on the disk
in fixed length records. These records are each 252 bytes or characters
in length and reside in one physical disk sector. Any record in a file
may be read or written upon request and the data in each record is
easily defined to be ASCII or numeric data. Strings may be stored on
disk as characters and numbers may be stored in four byte binary form,
eliminating the need for I/O conversions. Record I/O is a very
efficient method of saving data on a disk file.
Since record I/O files are random files, they are opened and closed
exactly like virtual arrays. See section 11.3 for details. It is
important to remember that random files are special and may be read in
either a random or sequential manner. Sequential files however, may
only be read sequentially. An attempt to open a sequential file for
random operations will result in error number 48. The user will find
the plain OPEN statement (without the NEW or OLD modifier) to be the
most useful since it will work with existing files, or create a new file
if the file referenced does not exist, without causing an error.
Closing a record I/O file is exactly like closing any file and all of
the same rules apply, as stated earlier.
-57-
TSC BASIC User's Manual
The first expression in each line represents the internal channel number
referenced in the OPEN statement and must be between 1 and 12. The
RECORD portion of each line is optional, and if used, the expression
following it designates which record number of the file should be used.
If the RECORD option is not specified, the next sequential record will
be read or written. The GET statement will read the appropriate record
from the disk file into the I/O buffer associated with the channel
number used. The PUT statement will write the contents of the I/O
buffer to the specified record of the file.
10 OPEN "TESTS" AS 2
20 GET #2, RECORD 25
30 PUT #2
The PUT statement in line 30 will write record number 26 to the disk
file since it is the next sequential after record 25.
So far, methods of opening and closing record I/O files have been
described, as well as methods of reading and writing the I/O buffer
associated with the file. This section and the following deal with the
manipulation of the data in the I/O buffer.
For each record I/O file opened, there exists an I/O buffer
designated by the internal channel number used with the OPEN statement.
Each I/O buffer is 252 characters in length and is used for temporary
storage of each disk file record as it is being operated on. The FIELD
statement is used to associate string names with various parts of the
I/O buffer. Its syntax is:
where the expression designates the internal channel number used in the
OPEN statement. Expression 1 is used to designate the length, in
characters, of the associated string variable and string var1 is a
unique string variable name for this part of the buffer. As many
expressions and names as desired may be listed and are associated left
to right in the I/O buffer assigned to the channel number referenced.
-58-
TSC BASIC User's Manual
As an example:
A$ B$ W$
As shown in the diagram, line 100 would associate the string A$ with the
first 20 character positions in the I/O buffer, B$ with the next 10
character positions, and W$ with the next 6 positions. The remaining
216 characters of the buffer are left undefined. The total number of
characters positions associated with an I/O buffer must be less than or
equal to 252. Each time a FIELD statement is executed, it will start
the string association with the first character position in the buffer,
regardless of how the buffer has been previously defined with prior
FIELD statements. Once a variable name has been fielded by using the
FIELD statement, its value will be whatever is currently in the I/O
buffer it is associated. If the contents of the buffer change (by
executing a GET statement) the contents of the string will also change.
The string length will be the length allocated for that string in the
FIELD statement.
The FIELD statement does not move any data between variables and the
I/O buffer but simply sets up a field definition for later use using
LSET and RSET. Using a FIELD statement to associate a string variable
with an I/O buffer is temporary and the definition is nullified by any
attempt to assign a value to the string variable by using LET or the
implied LET. As an example:
10 OPEN "TEST" AS 1
20 FIELD #1, 50 AS B$
30 B$="TEST STRING"
Line 30 does not put the string "TEST STRING" into the I/O buffer but
instead removes B$'s association with the I/O buffer giving it new
storage area for the string. The result is that line 30 nullifies the
FIELD definition setup in line 20.
-59-
TSC BASIC User's Manual
Z$ A$ B$
18 bytes
This line would cause A$ and B$ to point to the desired sub-record. The
string Z$ is used as a "dummy string". Its purpose is to skip the first
four records (4 times 18 is 72). A more general statement may be used
which will allow accessing any one of the 14 records in the I/O buffer.
A$(0) B$(0) A$(1) B$(1) A$(2) B$(2) A$(3) B$(3) A$(4) B$(4)
Z$
I:1 I:2 I:3 I:4 I:5
When executing the above statement, the variable I should contain the
desired sub-record number (a number between 1 and 14). As an example,
if I is equal to 3, the dummy string Z$ will be assigned the first 36
character positions, allowing A$ and B$ to point to the third
sub-record. If I is 1, A$ and B$ will point to the first sub-record
since Z$ was given zero character positions in the buffer.
A$[0] B$[0] A$[1] B$[1] A$[2] B$[2] A$[3] B$[3] A$[4] B$[4]
Z$
This set of statements will associate each element of the string arrays A$
and B$ with a sub-record in the I/O buffer. A$(O) and B$(O) will be
associated with the first sub-record, A$(1) and B$(1) with the second,
and so on.
-60-
TSC BASIC User's Manual
The FIELD statement has been used to associate a string with an I/O
buffer. Once fielded, the strings contents may be altered by using RSET
or LSET. These statements are similar to the LET statement except the
string storage location is not changed as it is with LET. The syntax
for these two statements is as follows:
10 OPEN "DATA5" AS 1
20 FIELD #1, 10 AS A$, 40 AS B$, 70 AS C$
30 GET #1, RECORD 15
40 PRINT A$
50 PRINT B$
60 PRINT C$
70 LSET A$="NEW A$"
80 LSET B$="NEW VALUE FOR B$"
90 RSET C$="NEW RIGHT JUSTIFIED C$"
100 PUT #1, RECORD 15
110 CLOSE 1
Line 10 opens the file DATA5.DAT on the working drive. Line 20 sets A$,
B$, and C$ to the channel 1 I/O buffer. Line 30 reads record number 15
into the I/O buffer. The fielded string variables now contain the
values from that record, so the print statements on lines 40 through 60
will print their values. The strings printed reflect what is contained
in those character positions of record 15. Lines 70 through 90 assign
new values to these strings using LSET and RSET. Remember that the new
strings are actually being stored in the I/O buffer. Line 100 writes
the I/O buffer back into record number 15 of the data file. If line 100
were omitted from this program, the file would remain unchanged. The
file is finally closed in line 110.
-61-
TSC BASIC User's Manual
A$ = CVTF$(X)
X = CVT$F(A$)
After the variables are dimensioned and the file is opened, lines 30
through 50 setup the FIELD definition. Each element of the string array
A$ is associated with a four byte section of the I/O buffer. It is
assumed that the array A is assigned values between lines 50 and 200.
Lines 200 through 220 assign the new buffer values by assigning to each
element of the previously fielded array A$. Notice that the CVTF$
function is used to store the floating point elements of the array A
into the buffer. Line 230 writes the record to the disk file and line
240 closes the file.
-62-
TSC BASIC User's Manual
Line 30 in the above program will cause an error number 24 since the
file opened was just created (OPEN NEW) and only contains one record.
To make this program run without an error, it is necessary to extend the
file before the reference is made.
This program will run without error since line 30 extends the file to
contain at least 20 records. It is not necessary to extend a file to
its final value before use, since it can be extended at anytime, but it
must be extended to the size required to accomodate all record
references in the program being run. All new records created in a file
while the extending process is operating will contain null characters
(0's). Keep in mind that the file extension process can take a long time
to complete.
-63-
TSC BASIC User's Manual
10 OPEN "EMPLOYEE" AS 1
20 FIELD #1, 20 AS N$, 69 AS D$, 15 AS P$
30 INPUT "ENTER EMPLOYEE NUMBER",E
40 IF E>10O THEN 30 ELSE IF E<=0 THEN END
50 GET #1, RECORD E
60 PRINT N$,P$
70 INPUT "CHANGE NUMBER",R$
80 IF LEFT$(R$)<>"Y" THEN 30
90 INPUT "NEW NUMBER",A$
100 LSET P$=A$
110 PUT #1, RECORD E
120 PRINT "NUMBER CHANGED"
130 GOTO 30
-64-
TSC BASIC User's Manual
After the subroutine returns control to BASIC the USR function call
will assume the value returned in locations hex 26 and 27. The
following example demonstrates the mechanics of using USR without
performing any specific task.
ORG $5000
LDX $0026 GET PASSED ARGUMENT
*** ACTUAL CODE HERE
LDX #VALUE GET VALUE TO BE RETURNED
STX $0026 SAVE FOR BASIC TO USE
RTS SHOULD END WITH RTS
Lines 300 and 310 in the BASIC code set up the address of the machine
language routine ($5000) and puts it in location $24 (the USR vector).
Line 320 will pass the value 6 to the machine language routine. After
returning from the routine, the value returned will be multiplied by 10
and put in the variable A1. The assembly language code shown
demonstrates a method of passing the parameter to and from the user
-65-
TSC BASIC User's Manual
subroutine.
There are two ways to accomplish such a task. The first is to pass
a parameter to the USR routine which could be decoded by the actual
assembly routine to determine which of any other routines to jump to.
The second method, which is much simpler, is to change the USR routine
start address as desired. This is done via the POKE command.
You might want to consider line 190 as part of the USR call for the
routine at $6E00 and line 210 as part of the USR call for $6FFO. In
fact it might make sense to put the two steps into a single line using
the multiple statements per line character. This is done in the
following example.
You can see that if there were to be many calls to the USR routines
this method would make things much simpler and cleaner.
-66-
TSC BASIC User's Manual
After the subroutine returns control to BASIC the USR function call
will assume the value returned in locations hex 7FFB and 7FFC. The
following example demonstrates the mechanics of using USR without
performing any specific task.
ORG $C100
LDX $7FFB GET PASSED ARGUMENT
*** ACTUAL CODE HERE
LDX #VALUE GET VALUE TO BE RETURNED
STX $7FFB SAVE FOR BASIC TO USE
RTS SHOULD END WITH RTS
Lines 300 and 310 in the BASIC code set up the address of the machine
language routine ($C1OO) and puts it in location $7FFD (the USR vector).
Line 320 will pass the value 6 to the machine language routine. After
returning from the routine, the value returned will be multiplied by 10
and put in the variable A1. The assembly language code shown
demonstrates a method of passing the parameter to and from the user
subroutine.
-67-
TSC BASIC User's Manual
There are two ways to accomplish such a task. The first is to pass
a parameter to the USR routine which could be decoded by the actual
assembly routine to determine which of any other routines to jump to.
The second method, which is much simpler, is to change the USR routine
start address as desired. This is done via the POKE command.
You might want to consider line 190 as part of the USR call for the
routine at $AEOO and line 210 as part of the USR call for $AFFO. In
fact it might make sense to put the two steps into a single line using
the multiple statements per line character. This is done in the
following example.
You can see that if there were to be many calls to the USR routines
this method would make things much simpler and cleaner.
-68-
TSC BASIC User's Manual
All errors are assigned numbers below 100 except the arithmetic
errors which range from 101 through 108 and error number 255. Error 255
informs you that an illegal token has been encountered. This error
should never be encountered during normal program debugging. Its
occurrence indicates the presence of a bad memory location or other
serious problems.
The errors are divided into two tables. Table one contains all of
the I/O related errors and are numbered 1 through 49. It is this set of
errors which may be acted upon by using the ON ERROR statement. It
should be noted that all errors below error number 30 are FLEX errors
and their numbers are identical to the FLEX error numbers. The second
error table contains error numbers which are related to syntax or
computational type errors. These errors may not be trapped using the ON
ERROR statement.
-69-
TSC BASIC User's Manual
NUMBER MEANING
_______________________________________________________
-70-
TSC BASIC User's Manual
NUMBER MEANING
_______________________________________________________
50 UNRECOGNIZABLE STATEMENT
51 ILLEGAL CHARACTER IN LINE
52 SYNTAX ERROR
53 ILLEGAL LINE TERMINATION
54 LINE NUMBER 0 NOT ALLOWED
55 UNBALANCED PARENTHESES
56 ILLEGAL FUNCTION REFERENCE
57 MISSING QUOTE IN STRING CONSTANT
58 MISSING "THEN" IN AN "IF" STATEMENT
80 MEMORY OVERFLOW
81 ARRAY OVERFLOW
83 STRING TOO LONG
-71-
TSC BASIC User's Manual
Before BASIC can be run, FLEX should be running and the three plus
sign prompt (+++) should be present. Insert the disk containing BASIC
into the system drive and type BASIC. After a few seconds, BASIC should
respond with "READY". BASIC is ready to go at this time. If BASIC is
ever left by using RESET or the EXIT command, the WARM start entry point
should be used. Entry at COLD start will clear out any program you may
have entered while entry at WARM start will preserve it.
14. RENUMBER
where the + sign tells BASIC to send the following command to FLEX which
gets the renumber command. The first number represents the number which
should be assigned to the first line of the program. The increment
indicates what value should be added to each successive line. Both of
these values default to 10 if no numbers are specified. For example:
+RENUMBER
+RENUMBER,100,20
The first example will renumber the program with line number increments
of 10 and the first line number will be 10. The second line will
renumber it with the first line being 100 and a line increment of 20.
Long source files may require a long time to renumber.
-72-
TSC BASIC User's Manual
There are several key locations in BASIC which will help you adapt
it to your particular hardware configuration.
If you are running a 6800 system, which has 20K of memory starting
at location 0, has an ACIA for terminal I/O at location hex 8004, and is
using FLEX, no adaptions need be performed. It is recommended that this
section is read whether or not it is necessary to make adaptions since
other useful information is contained. After making any necessary
changes, save BASIC back onto disk from location hex 20 through hex
35FF. The transfer address should be hex 100.
MEMEND $20-21. These two bytes specify to BASIC what the end of
memory should be. As BASIC is distributed, this location is
set to $4FFF, or for a 20K system. If more memory is
installed in your computer, set these bytes accordingly. It
may be desirable to set these lower than the actual end of
memory to save space for a USER supplied subroutine to be
called with the USR function.
ACIA $22-23. These bytes contain the base location of the ACIA
being used for terminal I/O. If yours is different from
$8004, set accordingly. This location is used by the routine
which tests for a control C. If your system does not use an
ACIA for terminal input, see section 15.4 below.
COLD $100. This is the cold start address used to initialize BASIC
when first bringing up BASIC.
WARM $103. This is the warm start address normally used to enter
BASIC after doing an EXIT or FLEX command. It preserves any
program currently in BASIC, and consequently does not reset
the stack pointer on re-entry. If the stack pointer has been
changed since exiting BASIC, unexpected results can occur.
-73-
TSC BASIC User's Manual
EXIT $106. This is used by BASIC when the EXIT command is typed
and should be set to jump to the entry point in the monitor
ROM being used. It is currently $EODO for MIKBUG
compatibility.
If your system does not use an ACIA for terminal input, you will
need to supply a routine which checks to see if a character has been
received from the keyboard. If you do not need the control C break
capability, set the ACIA address described above to point to a zero byte
in ROM. This will disable this feature. The user supplied routine
should check if a key has been typed, and return the zero status bit
cleared (NE status) if so. The character should not be input! Make the
following patches:
at $0202 put BD O1 09 O1
at $0253 put BD xx xx O1
at $02B4 put BD xx xx O1
where 'xx xx' represents the address of your check key typed routine.
-74-
TSC BASIC User's Manual
There are several key locations in BASIC which will help you adapt
it to your particular hardware configuration. If you are running a 6809
system which has an ACIA for terminal I/O at location hex E004, no
adaptions need be performed. It is recommended that this section is
read whether or not it is necessary to make adaptions since other useful
information is contained. After making any necessary changes, save
BASIC back onto disk from location hex 0 through hex 35FF. The transfer
address should be hex 0000.
MEMEND $CC2B-CC2C. These two bytes specify to BASIC what the end of
memory should be. These bytes are part of the FLEX operating
system and are set by FLEX. These may be changed by the user
if so desired (to a lower value only). It may be desirable to
set these lower than the actual end of memory to save space
for a USER supplied subroutine to be called with the USR
function. If the memory end is changed, you must enter BASIC
through the cold start entry point at location 0. Entry
through warm start after changing memory end will cause
program errors.
ACIA $4B-4C. These bytes contain the base location of the ACIA
being used for terminal I/O. If yours is different from
$E004, set accordingly. This location is used by the routine
which tests for a control C. If your system does not use an
ACIA for terminal input, see section 15.8 below. After
changing these bytes, the cold start entry point should be
used (location 0).
WARM $0003. This is the warm start address normally used to enter
BASIC after doing an EXIT or FLEX command. It preserves any
program currently in BASIC.
-75-
TSC BASIC User's Manual
EXIT $0006. This is used by BASIC when the EXIT command is typed
and should be set to jump to the entry point in the monitor
ROM being used. It is currently $F814, the SBUG entry point.
If your system does not use an ACIA for terminal input, you will
need to supply a routine which checks to see if a character has been
received from the keyboard. If you do not need the control C break
capability, set the ACIA address described above to point to a zero byte
in ROM. This will disable this feature. The user supplied routine
should check if a key has been typed, and return the zero status bit
cleared (NE status) if so. The character should not be input! Make the
following patches:
at $0162 put BD OO OC 12
at $O1BA put BD xx xx 12 12
at $0212 put BD xx xx 12 12
where 'xx xx' represents the address of your check key typed routine.
-76-
TSC BASIC User's Manual
HEXADECIMAL
HEXADECIMAL
HEXADECIMAL
CHARACTER
CHARACTER
CHARACTER
DECIMAL
DECIMAL
DECIMAL
NUL 00 000 + 2B 043 V 56 086
SOH O1 001 , 2C 044 W 57 087
STX 02 002 - 2D 045 X 58 088
ETX 03 003 . 2E 046 Y 59 089
EOT 04 004 / 2F 047 Z 5A 090
END O5 005 0 30 048 ( 5B 091
ACK 06 006 1 31 049 \ 5C 092
BEL 07 007 2 32 050 ) 5D 093
BS 08 008 3 33 051 ^ 5E 094
HT 09 009 4 34 052 _ 5F 095
LF OA 010 5 35 053 ` 60 096
VT OB 011 6 36 054 a 61 097
FF OC 012 7 37 055 b 62 098
CR OD 013 8 38 056 c 63 099
SO OE 014 9 39 057 d 64 100
SI OF 015 : 3A 058 e 65 101
DLE 10 016 ; 38 059 f 66 102
DC1 11 017 , 3C 060 g 67 103
DC2 12 018 = 3D 061 h 68 104
DC3 13 019 > 3E 062 i 69 105
DC4 14 020 ? 3F 063 j 6A 106
NAK 15 021 @ 40 064 k 6B 107
SYN 16 022 A 41 065 l 6C 108
ETB 17 023 B 42 066 m 6D 109
CAN 18 024 C 43 067 n 6E 110
EM 19 025 D 44 068 o 6F 111
SUB 1A 026 E 45 069 p 70 112
ESC 1B 027 F 46 070 q 71 113
FS 1C 028 G 47 071 r 72 114
GS 1D 029 H 48 072 s 73 115
RS 1E 030 I 49 073 t 74 116
US 1F 031 J 4A 074 u 75 117
SP 20 032 K 48 075 v 76 118
! 21 033 L 4C 076 w 77 119
" 22 034 M 4D 077 x 78 120
# 23 035 N 4E 078 y 79 121
$ 24 036 0 4F 079 z 7A 122
% 25 037 P 50 080 { 78 123
& 26 038 Q 51 081 / 7C 124
' 27 039 R 52 082 } 7D 125
( 28 040 S 53 083 ~ 7E 126
) 29 041 T 54 084 DEL 7F 127
* 2A 042 U 55 085
-77-
TSC BASIC User's Manual
COMMANDS
NAME SECTION
STATEMENTS
"+" 5.0
NAME SECTION CLEAR 5.0
COMPILE 5.0
CHAIN 8.9 CONT 5.0
CLOSE 8.4 EXIT 5.0
DATA 6.1 FLEX 5.0
DEF 6.7 LIST 5.0
DIM 6.7 LOAD 5.0
END 6.6 NEW 5.0
EXEC 10.1 RUN 5.0
FIELD 10.10 SAVE 5.0
FOR 6.5
GET 10.9
GOSUB 6.2
GOTO 6.2 FUNCTIONS
IF 6.3
INPUT 6.4 NAME SECTION
INPUT LINE 6.4
KILL 8.7 ABS 7.5
LET 6.1 ASC 7.3
LSET 10.11 ATN 7.2
NEXT 6.5 CHR$ 7.3
ON ERROR 6.2 COS 7.2
ON GOSUB 6.2 CVT$F 10.12
ON GOTO 6.2 CVTF$ 10.12
OPEN 8.1 ERL 9.3
10.3 ERR 9.3
POKE 6.7 EXP 7.1
PRINT 6.4 HEX 7.3
PUT 10.9 INT 7.5
READ 6.1 LEFT$ 7.3
REM 6.7 LEN 7.3
RENAME 8.8 LOG 7.1
RESTORE 6.1 MID$ 7.3
RESUME 6.2 PEEK 7.4
RETURN 6.2 PI 7.5
RSET 10.11 POS 7.4
STOP 6.6 PTR 7.5
RIGHT$ 7.3
RND 7.5
SGN 7.5
SIN 7.2
SPC 7.4
SQR 7.1
STR$ 7.3
TAB 7.4
TAN 7.2
VAL 7.3
-78-