Basic Commands - Commodore PET 2001 Series Introduction Manual

Hide thumbs Also See for PET 2001 Series:
Table of Contents

Advertisement

2 . B a s i c c o m m a n d s
Basic Commands and Statements
COMMAND/
S T A T E M E N T
E X A M P L E
CLR
C L R
CMD
CMD D
C O N T
C O N T
G O T O
GOTO L
F R E
PRINT FIRE (0)
END
END
LET
LET A-2
L I S T
L I S T
L I S T - L
L ) S T L - M
L)ST L
LOAD
LOAD
LOAD "NAME"
LOAD "NAME," D
NEW
N E W
P E E K
P E E K ( A )
P O K E
P O K E A , B
PRINT
PRINT A
PRINT A$
P R I N T # L , A
PRINT #L,A$
RUN
RUN
RUN L
S A V E
S A V E
SAVE "NAME"
SAVE "NAME,",D
SAVE "NAME,",D,C
STOP
STOP
SYS
S Y S ( X )
40
PURPOSE
Sets variables to zero or null.
K e e p I E E E d e v i c e D o p e n t o m o n i t o r b u s .
Continue program execution after a STOP
command. No program changes permitted.
C o n t i n u e p r o g r a m e x e c u t i o n a t l i n e L a f t e r
a STOP command. Program changes are
p e r m i t t e d .
Returns number of bytes of available
m e m o r y .
Ends program.
Assign a value to a variable.
Lists current program.
L i s t s c u r r e n t p r o g r a m t h r o u g h l i n e L .
L i s t s l i n e s L t h r o u g h M o f c u r r e n t p r o g r a m .
L i s t s c u r r e n t p r o g r a m f r o m l i n e L t o e n d .
Loads next encountered program from
b u i l t - i n t a p e u n i t .
L o a d s p r o g r a m N A M E f r o m b u i l t - i n t a p e
u n i t .
L o a d s p r o g r a m N A M E f r o m d e v i c e D .
D e l e t e s c u r r e n t p r o g r a m f r o m m e m o r y ,
sets variables to zero.
Returns byte value from address A.
Loads byte B into address A.
Prints value of A on display screen.
Prints specified string on screen.
P r i n t s v a l u e o f A o n l o g i c a l f i l e L .
Prints specified string on logical file L.
Begins execution of program at lowest
line number.
Begins execution of program at line L.
Saves current program on built-in tape
u n i t .
Saves current program NAME on
b u i l t - i n t a p e u n i t .
Saves current program NAME on device D.
Saves program NAME on device D. C spec
ifies EOF or EOT.
Stops program execution.
C o m p l e t e c o n t r o l o f P E T i s t r a n s f e r r e d t o
a subsystem at decimal address contained
in the argument.
Basic Commands and Statements (Continued)
COMMAND/
S T A T E M E N T
E X A M P L E
TI$-"HHMMSS"
TI$
TI
PRINT TI
USR
USR(X)
WAIT
WAIT A,B,C
(Note' the WAIT com-
mand may not operate
on your particular PET)
1 0 C L O S E L
CLOSE
1 0 D A T A 1 , 2 , 3 , 4
DATA
2 0 D A T A T O M , S U E
30 DATA "TOM DOE"
10 DIM A(n)
DIM
2 0 D I M A ( n , m , o , p )
30 DIM A(o),B(m)
40 DIM Aft
50 DIM A$(n)
999 END
E N D
GET
1 0 G E T C
2 0 G E T C $
3 0 G E T # L , C
4 0 G E T # L , C $
1 0 I N P U T A
I N P U T
2 0 I N P U T A $
30 INPUT A,A$,B,B$
4 0 I N P U T # L , A
50 INPUT #L,A$
60 INPUT #L,A,A$,B,B$
PURPOSE
Sets PET's internal clock to real time.
Displays number of 'jiffies' since PET was
powered up or clock was zeroed. (A jiffy
- 1 r'60 of a second.)
Transfers program control to a program
whose address is at locations 1 and 2. X is
a parameter passed to and from the
machine language program.
Stops execution of BASIC until contents
of location A, ANDed with B and exclusive
ORed with C, is not equal to zero. C is
optional and defaults to zero.
Closes logical file L.
Specifies data to be read from left to right.
Alphabetics do not need to be enclosed in
quotes.
If strings contain spaces, commas, colons,
or graphic characters, the string must be
enclosed in quotes.
Specifies maximum number of elements
in an array or matrix.
Specifies maximum number of dimensions
in an array.
Number of arrays limited by memory.
May be dimensioned dynamically.
Strings may be dimensioned.
Terminates program execution.
Accepts single numeric character from
keyboard.
Accepts single string character from
keyboard.
Accepts single character from specified
logical file,
Accepts specified single string character
from logical file.
Accepts value of A from keyboard.
Accepts value of string variable A from
keyboard. The string does not have to be
enclosed in quotes.
Accepts specified values from keyboard.
Accepts value of A from logical file L.
Accepts specified string from logical file L.
Accepts specified values and strings from
logical file L. Strings do not have to be
enclosed in quotes.
41

Advertisement

Table of Contents
loading

Table of Contents