BASIC Commands


Cmd       Abbr/Ex.            Comment

Commands

BYE       B.                  Goes to memo pad or self-test mode
CLR       CLR                 Clears all variables
CONT      CON.                Continues execution after  or STOP
DIM       DI. A$(30)          Reserves 30 bytes for A$
          DI. B(100)           Defines an array with 101 positions
          DI. C(17,3)          Defines an 18 x 4 array
END       END                 Closes files, turns off sound, halts program
LET       LE. A=B             Assigns variable A to the value of variable B
          C$=D$                (the word LET can be omitted)
LIST      L.                  Lists a program
          L. 400,500           Lists program lines 400 through 500
NEW       NEW                 Erases program and variables from memory
POKE      POKE Y,X            Writes value X to memory address Y
REM       . program comment   Comment
RUN       RU.                 Begins execution of program in memory
          RU. "D1:MYPROG       Loads MYPROG from disk and runs it
STOP      STO.                Halts program without closing files

Program Statements

FOR, TO,  F. X=3 TO 9 STEP 2  STEP may be omitted for step value of 1
 STEP...                      3, 9, and 2 may be arithmetic expressions
 NEXT     N. X
GOSUB...  100 GOS. 300:___    RETURN goes to the statement following
 RETURN   300 ?                the colon.
          400 RET.
GOTO      G. X                X may be a variable or line number
IF/THEN   IF Y=5 THEN 500     Conditional branch
          IF X THEN Y=6         X=0 is false, X>0 is true.
          IF A$="Y" THEN A=1:?  False goes to next line number; true
                                executes the rest of the line
ON/GOSUB  ON X GOS. 20,30,40  If X<1 or X>3, it goes to the next line
ON/GOTO   ON X G. 20,30,40
POP       POP                 Use when RETURN or NEXT is bypassed
TRAP      T. 1000             Identifies the line to GOTO if error occurs
          T. 32768             If TRAP >32767, previous TRAP is cleared

I/O Commands

CLOAD     CLOA.               Loads a program from cassette
CLOSE     C. #2               Closes a file (no error if file is not open)
CSAVE     CS.                 Saves a program to cassette
DOS       DO.                 Goes to DOS (if DOS not loaded, same as BYE)
ENTER     E. "D1:MYPROG       Loads a program saved with LIST
GET       GE. #5,Y            Input a single byte
INPUT     I. Y$               Prints "?", then receives data from keyboard
          I. #1,A              Receives data from file #1
          I. #16,Y$            Recieves data from keyboard with no "?"
LIST      L. "D1:MYPROG       Lists a program to a file
LOAD      LO. "D1:MYPROG      Loads a program save with SAVE
LPRINT    LP. A$              Prints a line to printer
NOTE      NO. #2,A,B          Detects sector and byte within file
OPEN      O. #2,N,0,"D1:FILE  Open FILE; N=4 - input   N=6 - directory
                                         N=7 - dir w/ <> (DOS 2.5)
                                         N=8 - output  N=9 - append
                                         N=12 - input and output
POINT     P. #3,A,B           Position on sector A, byte B within a file
PRINT     ? A,B;"HERE"        Comma tabs, semicolon appends
PUT       PU. #5,Y            Output a single byte
READ      REA. A,B            Assigns data values from DATA statements
DATA      D. 5,10,16,3        Hold data values for READ
RESTORE   RES. 350            Data for next READ is on line 350
SAVE      S. "D1:MYPROG       Saves a program to be loaded with LOAD or RUN
STATUS    ST. #3,A            Sets A to the device status value
XIO       XIO cmd,#5,aux1,aux2,"S:"  (See XIO Command Codes)