
 APPEND

  format: APPEND#<FILE NUMBER>,"<NAME>"[,D<X>][ON U<Y>]
  purpose: To write additional data to the end of a CBM disk sequential file.
  remarks: APPEND is like a DOPEN except it applies only to sequential files.
           The CBM disk pointers are positioned beyond the current end of
           file.  Additonal data may then be written and the file re-closed.
           Whenever a variable or an evaluated expression is used as a
           filename it must be surrounded in parentheses.
           Unit defaults to 8, drive to 0.
  example: APPEND#1,"MASTER"
           Reopen master file on unit 8 drive 0 with a logical file #1 for
           future PRINT#.

  BACKUP

  format: BACKUP D<X> TO D<Y> [ON U<Z>]
  purpose: To duplicate the entire contents of a CBM disk to another diskette.
  remarks: User specified drive numbers must be 0 or 1. Drive numbers in the
                    BACKUP command must be unique. Unit defaults to 8.
  example: BACKUP D0 TO D1

 COLLECT
               Cleans up fragments in the disk directory after prolonged use.  
  example: COLLECT D1  (<D1> optional)
 
 CONCAT

  format: CONCAT [D<X>,]<"NAME1"> TO [D<Y>,]<"NAME2">[ON U<Z>]
  purpose: Concatinate sequential files.
  remarks: Old file name 2 is deleted and replaced with a new file which is
           the concatenation of the two files. Whenever a variable or an
           evaluated expression is used as a filename it must be surrounded
           by parentheses.
  example: CONCAT "YOURFILE"TO"MYFILE"
                     MYFILE becomes MYFILE + YOURFILE
           CONCAT D1,"<old>" TO D1,"<new>"  (<D1,> optional)
 COPY

  format: COPY [D<X>] TO [D<Y>]
  purpose: Make a copy of a file within a disk unit.
  remarks: The COPY command can only function between drives or a single drive
           within one unit. COPY without file names copies all files from Dx
           to Dy without altering files that already exist on Dy. Whenever a
           variable or an evaluated expression is used as a filename it must
           be surrounded by parentheses.
  example: COPY D0 TO D1 (copy all files from d0 to d1)
                     COPY D1,"TEXT" TO "BACKUP" (create BACKUP on drive 1)
                     COPY D1,"<old>"TO D1,"<new>"  (<D1,> optional)
 
 
  DCLOSE

  format:DCLOSE [#<1>] [ON U<x>]
  purpose: Close disk files.
  remarks: This command can close all files currently open on a disk unit or
           only the logical file specified. If no logical file number is
           specified, all files currently open will be closed. If both the
           logical file number and ON unit clauses are specified, the command
           still has the same effect as if only the logical file number was
           specified.
           In closing relative files, more records may be generated than
           were asked for, in order to fill out buffers in use.
  example: DCLOSE
                     DCLOSE#5
                     DCLOSE ON U7

 DIRECTORY or CATALOG

           Prints disk file listing to the screen without destroying the
           program in memory.  
  example: DIRECTORY D1 or CATALOG D1 (<D1> optional)

 DLOAD

           Like the normal load except defaults to device number 8.
           Loads into regular location at the bottom of basic memory.
  example: DLOAD D1,"<file name>"  (<D1,> optional)
 
 DOPEN

  format:DOPEN#<1>."<NAME>" [,L<y>] [,D<x>] [ON U<z>] [,W]
  purpose: Declare a sequential or random access file for read or write.
  remarks: #<1>. logical file number used to associate future disk operators
           back to this file open operation. 1<=1<=255. Logical file numbers
           greater than 128 cause a carriage return and line feed to be sent
           with each PRINT#. Logical file numbers less than 128 send only the
           carriage return. The carriage return can be suppressed by the use
           of the semi-colon.
           L<y>. .record length causes allocation of a random access file with
           record length y: 1<=y<=255. Opened for read and write, by default.
           D<x> drive number defaults to 0.
           U<z> unit defaults to 8.
           For sequential files, Write must be spaecified with a W, or the
           file will be opened to Read. Whenever a variable or an evaluated
           expression is used as a filename it must be surrounded in
           parentheses.
           It is possible to replace an existing file with DOPEN, using the
           @:
   example: DOPEN#2,"@file1",d1
                      DOPEN#5,(A$)
                     Where a$="filename"

 DS/DS$
           Returns a disk error code.  
  example: PRINT DS for error number or DS$ for complete message.

 DSAVE
           Like the normal save except defaults to device number 8.
  example: DSAVE D1,"<file name>"  (<D1,> optional)
 
 
 
 HEADER

  format: HEADER "<DISKNAME>",D<x> [,I<zz>] [ON U<Y>]
  purpose: To format a blank disk or clear an old disk.
  remarks: When I<zz>, a disk ID number, is specified this command formats the
           disk specified. Otherwise the directory is cleared and the new name
           assigned to the disk. This command requires caution in it's use.
           A media error is possible with the HEADER command. This can be
           caused by a missing disk, write protect tab in place, or bad media.
           The HEADER command reads the disk command channel and if an error is
           encountered, will return the error message "?BAD DISK".
           Whenever a variable or an evaluated expression is used as a disk
           name it must be surrounded by parentheses. The disk id (Izz) may
           not be specified with a variable.
  example: HEADER "MASTER DISK",D0,I01
                     HEADER"<diskname>", D1, I<ID>

 IF/GOTO        

           Similiar to the IF/THEN command except for directing the outcome
           directly to a specified line number rather than a possible action.
  example: IF A>2 GOTO 10
 
 RECORD

  format: RECORD#<logical file>,<record> [<byte>]
  purpose: Used before GET#, INPUT#, or PRINT# to position the record
           pointer in a random access file.
  remarks: Record number r such that 0<r<=65535. Byte pointer b such
           that 1<=b<=254. Default value is 1.
           When record pointer is set beyond last record the following
           conditions occur: If PRINT# is used, the appropriate number
           of records are generated to expand the file to the desired
           record. If INPUT# is used, a null line is returned with EOI
           in variable ST. If the record pointer is set beyond the end
           of the current end-of-file, DS$ will contain "RECORD NOT
           PRESENT".  Whenever a variable or an evaluated expression
           is used as a record number it must be surrounded in parentheses.

  example: 10 DOPEN#1,"RANDOM",L80
                      20 FOR I = 1TO10
                      30 RECORD#1,(I)
                      40 PRINT#1,"ABCDEFG"
                      50 NEXT
                      60 DCLOSE#1

 RENAME

  format: RENAME [D<x>,] "<old name>" TO "<new name>" [ON U<y>]
  purpose: Change the name of a disk file.
  remarks: The disk will not execute RENAME on any currently open file.
           Drive defaults to 0 and Unit defaults to 8.
           Whenever a variable or an evaluated expression is used as a
           filename it must be surrounded in parentheses.
  example: RENAME "MASTER" TO "BACKUP"
                   RENAME D1,"<old>"to D1,"<new>"  (<D1,> optional)


 
 
 SCRATCH
            Removes a filename specified from the disk.  
  example:  SCRATCH D1,"<file name>",8  (<D1,> optional)
 
 WAIT

  format: WAIT <address>,I[,j]
  purpose: To suspend program execution while monitoring the status of a
           machine input port.
  remarks: The WAIT statement causes execution to be suspended until a
           specified machine address develops a specified bit pattern. The
           data read at the address is exclusive ORed with the integer
           expression J, and then ANDed with I. If the result is zero,
           BASIC loops back and reads the data at the port again. If the
           result is nonzero, execution continues with the next statement.
           If J is ommitted, it is assumed to be zero.
           CAUTION: It is possible to enter an infinate loop with the WAIT
           statement, in which case it will be neccessary to manually
           restart the machine.
  example: 100 WAIT 59411,8,8
           This statement suspends execution until PLAY is pressed on the
           cassette unit (keep in mind this is for a PET 4032)

 STATUS
           STATUS is a system variable used to ascertain the status of the
           last I/O operation be it from an open channel on the keyboard,              
           screen or a disk drive. It's name may be STATUS in the book but              
           you can shorten it up to ST in your programs because no variable

           uses more than 2 letters anyway, to my knowledge.  I use the                  
           variable ST to detect when the end of an error message from the
           disk drive has occured, for instance.  This will read the error status
           from a disk drive.
  example:
           10 open15,8,15:rem open the command channel of the serial bus
           20 get#15,a$:if st=64then close15:print b$:end:rem check st for end
           30 b$=b$+a$:goto 20:rem string addition, loop if not finished

 VERIFY

           Verifies a filename located on disk with the program in memory.  
  example: VERIFY"<file name>",8