BASIC-SO
Statement
LINE INPUT
lSET
ON
ERROR
ON-GOTO
ON-GOSUB
OPEN
OPTION BASE
OUT
POKE
PRINT
PRINT USING
PUT
RANDOMIZE
READ
REM
RESTORE
RESUME
RETURN
RSET
STOP
SWAP
WAIT
Functions
ABS
ASC
ATN
COSl
CHR$
CINT
COS
CSNG
CVD
CVI
CVS
Language Elements
Table 2-2. BASIC-80 Statements
(Cont'd.)
Description
Enters entire line from a disk
file.
left
justifies
text
in random file buffer.
Traps
errors
by
branching
to
error-resolving routines.
Transfers execution
to
Xth line number
for expression
X.
Transfers execution
to
Xth subroutine
for expression
X.
Creates sequential
or
random
disk
files.
Starts arrays at 0
or
1.
Writes values
to
I/O
ports.
Writes byte
to
memory location.
1.
Displays
text
on terminal.
2.
Stores data in sequential
disk file.
Displays
text
according
to
given format.
Stores data in random disk file.
Initializes random number generator.
Assigns values from DATA statements
to program variables.
Comments in program
text
Resets pOinter for reading DATA
statements.
Restarts execution after errors.
Transfers control back
to
statement
following last GOSUB.
Right
justifies
text
in random file buffer.
Halts program execution.
Exchanges values of two variables of
similar type.
Halts execution until port changes.
Example
LINE INPUT
A$
LSET
A$
=
B$
ON
ERROR
GOTO
900
ON
X GOTO
460,
480
ON
X GOSUB
220, 240,
260
OPEN
"R",
1,
":F1:TRACE"
OPTION BASEO
OUTOOFO,12
POKE
OA077,
72
PRINT
A,
B,
C
PRINT
#4,
A$,
B$,
C$
PRINT USING "$$##,##;
125.38,21.14.6.10
PUT
#3,
A$,
B$
C$
RANDOMIZE
READ
A,
K1,
l%,
Z
10
REM
THIS
IS
20
REM
A REMARK
RESTORE
RESUME
RETURN
RSET
l$
=
MK$
STOP
SWAP
A1#,
B2#
WAIT 1,
04H,
OAH
Table 2-3. BASIC-80 Functions
Returns
Absolute value.
ASCII code
of
the first character of the
specified string.
Arctangent, in radians.
Double-precision floating-point value.
Character corresponding to the specified
ASCII
code.
Integer value
Cosine,
in
radians
Single-precision floating-point value.
Double-precision floating-point value equal to
8-byte string
A$
Integer value equal
to
2-byte string
A$
Single-precision floating-point value equal to
4-byte string
A$
Example
ABS(X)
ASC(A$)
ATN(X)
CDSl
(X)
CHR$
(X)
CINT(X)
COS
(X)
CSNG
(X)
CVD(X#)
CVI
(X%)
CVS(X!)
2-3