CHAPTER!
PAGE
INTRODUCTION
TO
BASIC-SO
Operating System Interface . . . . . . . . . . . . . . . . . . . . .
..
1-1
Invoking BASIC-80
...........................
1-1
Manipulating Files from BASIC-80
..
. . . . . . . . . .
..
1-2
Listing the Directory
of
a Disk. . . . . . . . . . . . . . .
..
1-3
Renaming a File. . . . . . . . . . . . . . . . . . . . . . . . . . .
..
1-3
Changing File Attributes
..
. . . . . . . . . . . . . . . . .
..
1-3
Deleting a File . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
1-3
Loading a
Program.
. . . . . . . . . . . . . . . . . . . . . . . . . . .
..
1-4
Saving a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
1-4
CHAPTER
2
LANGUAGE ELEMENTS
Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-1
Commands. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-1
Statements.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-1
Functions
....................................
2-5
Representing
Data
...............................
2-5
Syntax
.........................................
2-5
Numeric
Data
................
. . . . . . . . . . . . . . . .
..
2-5
Constants.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-6
Integer Constants
.....
. . . . . . . . . . . . . . . . . . . .
..
2-6
Decimal Integer Constants. . . . . . . . . . . . . . . . . .
..
2-6
Hexadecimal Integer Constants. . . . . . . . . . . . . .
..
2-6
Octal Integer Constants . . . . . . . . . . . . . . . . . . . .
..
2-7
Single-Precision Floating-Point Constants
......
2-7
Double-Precision Floating-Point Constants
.....
2-7
Variables
....................................
2-7
String
Data
...................................
2-8
String Constants . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-8
String Variables
.............................
2-8
Converting
Data
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-9
Array Variables
...............................
2-9
String Arrays
..............................
2-10
Operators and Precedence
of
Evaluation.
. . . . . .
..
2-11
Arithmetic Operators . . . . . . . . . . . . . . . . . . . . .
..
2-11
Relational Operators. . . . . . . . . . . . . . . . . . . . . .
..
2-11
Logical Operators . . . . . . . . . . . . . . . . . . . . . . . .
..
2-12
String
Operator
............................
2-12
Expressions
....
. . . . . . . . . . . . . . . . . . . . . . . . . . .
..
2-12
Numeric Expressions
.......................
2-12
String Expressions. . . . . . . . . . . . . . . . . . . . . . . .
..
2-12
CHAPTER
3
ENTERING
AND
EDITING PROGRAMS
Entering Instruction
Lines.
. . . . . . . . . . . . . . . . . . . . .
..
3-1
Correcting Entry
Errors.
. . . . . . . . . . . . . . . . . . . . . . .
..
3-1
Editing
Program
Text.
. . . . . . . . . . . . . . . . . . . . . . . . .
..
3-2
D Subcommand
...............................
3-3
L Subcommand
...............................
3-4
I Subcommand
...............................
3-4
H Subcommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-4
X Subcommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-4
S Subcommand
...............................
3-5
K Subcommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-5
C Subcommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-6
Q Subcommand
...............................
3-6
CONTENTS
PAGE
A Subcommand. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-6
E
Subcommand.
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-6
Carriage Return. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
3-6
CHAPTER
4
ERROR
HANDLING
BASIC-80
Error
Messages. . . . . . . . . . . . . . . . . . . . . .
..
4-1
Syntax Error Messages. . . . . . . . . . . . . . . . . . . . . . .
..
4-1
Overflow, Underflow, and Divide-by-Zero
........
4-1
Overflow
..................................
4-1
Underflow
.................................
4-2
Divide-by-Zero . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
4-2
Integer
Operations
............................
4-2
Error
Trapping
..
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
4-2
Trace Facility. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
4-3
Error
Simulation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
4-4
Restarting
Program
Execution
....................
4-4
CHAPTER
5
DISK FILE
INPUT
IOUTPUT
Sequential File
I/O
. . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
5-1
Opening a Sequential File. . . . . . . . . . . . . . . . . . . . .
..
5-1
Writing to a Sequential
File.
. . . . . . . . . . . . . . . . . .
..
5-2
Reading from a Sequential
File.
. . . . . . . . . . . . . . .
..
5-2
Closing a Sequential File
...
. . . . . . . . . . . . . . . . . .
..
5-3
Random File
I/O
................................
5-4
I/O
Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
..
5-4
Defining a Random
I/O
Field-FIELD
...........
5-4
Opening and Closing a Random Disk
File.
. . . . . .
..
5-6
Reading from a Random
I/O
File
................
5-6
Writing to a Random
I/O
File
...................
5-7
CHAPTER
6
COMMANDS
AND
STATEMENTS
CHAPTER 7
FUNCTIONS
APPENDIX
A
BASIC-SO ERROR CODES
APPENDIXB
BASIC-SO RESERVED WORDS
APPENDIXC
BASIC-SO COMMAND CHARACTERS
APPENDIXD
ASCII CODES
APPENDIXE
CALLING NON-BASIC-SO SUBROUTINES
APPENDIXF
RMX/80
BASIC-80
v