BASIC-SO

Language Elements

Table 2-2. BASIC-80 Statements (Cont'd.)

Statement

 

 

Description

 

 

Example

 

 

 

 

 

 

 

LINE INPUT

 

Enters entire line from a disk file.

 

LINE INPUT A$

lSET

 

left justifies text in random file buffer.

 

LSET A$ = B$

ON ERROR

 

Traps errors by branching to

 

ON ERROR GOTO 900

 

 

 

error-resolving routines.

 

 

 

ON-GOTO

 

Transfers execution to Xth line number

 

ON X GOTO 460, 480

 

 

 

for expression X.

 

 

 

ON-GOSUB

 

Transfers execution to Xth subroutine

 

ON X GOSUB 220, 240, 260

 

 

 

for expression X.

 

 

 

OPEN

 

Creates sequential or random disk files.

 

OPEN "R", 1, ":F1:TRACE"

OPTION BASE

 

Starts arrays at 0 or 1.

 

OPTION BASEO

OUT

 

Writes values to I/O ports.

 

OUTOOFO,12

POKE

 

Writes byte to memory location.

 

POKE OA077, 72

PRINT

 

1.

Displays text on terminal.

 

PRINT A, B, C

 

 

 

2.

Stores data in sequential

 

PRINT #4, A$, B$, C$

 

 

 

 

disk file.

 

 

 

PRINT USING

 

Displays text according to given format.

 

PRINT USING "$$##,##;

 

 

 

 

 

 

125.38,21.14.6.10

PUT

 

Stores data in random disk file.

 

PUT #3, A$, B$ C$

RANDOMIZE

 

Initializes random number generator.

 

RANDOMIZE

READ

 

Assigns values from DATA statements

 

READ A, K1, l%, Z

 

 

 

to program variables.

 

 

 

REM

 

Comments in program text

 

10 REM THIS IS

 

 

 

 

 

 

20 REM A REMARK

RESTORE

 

Resets pOinter for reading DATA

 

RESTORE

 

 

 

statements.

 

 

 

RESUME

 

Restarts execution after errors.

 

RESUME

RETURN

 

Transfers control back to statement

 

RETURN

 

 

 

following last GOSUB.

 

 

 

RSET

 

Right justifies text in random file buffer.

 

RSET l$ = MK$

STOP

 

Halts program execution.

 

STOP

SWAP

 

Exchanges values of two variables of

 

SWAP A1#, B2#

 

 

 

similar type.

 

 

 

WAIT

 

Halts execution until port changes.

 

WAIT 1, 04H, OAH

 

 

 

 

 

 

 

 

 

 

 

Table 2-3. BASIC-80 Functions

 

 

 

 

 

 

 

 

Functions

 

 

 

Returns

 

Example

 

 

 

 

 

ABS

 

Absolute value.

 

ABS(X)

ASC

 

ASCII code of the first character of the

ASC(A$)

 

 

specified string.

 

 

ATN

 

Arctangent, in radians.

 

ATN(X)

COSl

 

Double-precision floating-point value.

 

CDSl (X)

CHR$

 

Character corresponding to the specified ASCII

CHR$ (X)

 

 

code.

 

 

 

 

CINT

 

Integer value

 

CINT(X)

COS

 

Cosine, in radians

 

COS (X)

CSNG

 

Single-precision floating-point value.

 

CSNG (X)

CVD

 

Double-precision floating-point value equal to

 

CVD(X#)

 

 

8-byte string A$

 

 

CVI

 

Integer value equal to 2-byte string A$

 

CVI (X%)

CVS

 

Single-precision floating-point value equal to

 

CVS(X!)

 

 

4-byte string A$

 

 

2-3

Page 13
Image 13
Intel 9800758-02 manual BASIC-80 Statements Contd, BASIC-80 Functions