X L0AT810a[2] RW!((  0D 0Re  ٱF 0E  F D 08DE BLDi1i1 ЋЈ8`SYS EXSOD/xH)ӄDEDFȱD;GFDȱDI8eDDEDFDEFGIFGhөX"/l .  .  / @ Y0 / m `hh8`aBXEDOC 5 README DOC?README TXTAUTORUN BAT*  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ CHAPTER 8 USING DOS XE WITH ATARI BASIC Because this section is about programming, it will not be of interest  to nonprogrammers. Although it concerns Atari BASIC , much of the information will be useful to those who program in other languages. Atari BASIC has many commands designed to be used with disk  drives. All of them can be used with the Atari XF551 and DOS XE. This chapter will explore how each command works with DOS XE. Most of the commands also have other uses. For example, the command RUN (without a pathname) will RUN the program in memory, PRINT can address any device, including the screen and a printer. In the interests of clarity, we will limit ourselves to describing the uses of the commands with DOS XE . The Atari BASIC Reference Manual, inside Atari BASIC, and other books cover these other uses in detail. Before we discuss the commands, we will look at how Atari BASIC programs are stored on disks. TOKENISED AND UNTOKENISED PROGRAMS As each line of a BASIC program is typed in, it is translated into a tokenised form and stored in memory. This makes the program smaller and helps it to run faster.When you list a program, it is translated from the tokens back into words so you can read it. BASIC programs are usually stored on disk in tokenised form. Tokenised programs are stored with the SAVE command. They are reloaded with the LOAD command. Files of tokenised BASIC programs are usually called BASIC files. They are  often identified with the ".BAS" extension. BASIC programs can also be stored in untokenised form, exactly as they appear on the screen. Files of untokenised BASIC programs are simple ATASCII text files; if you look at them with the View A File option, they look just like they do on the screen. Untokenised BASIC programs are stored with the LIST command. They are reloaded with the  ENTER command. PAGE 81 Files of untokenised programs are usually called LISTed files. They are often identified with the ".LST" extension. LISTi ng and ENTERing programs in untokenised form is slower than SAVEing and LOADing them in tokenised form. The untokenised versions are larger and must be translated as they are LISTed or ENTERed.  DOS XE PATHNAMES AND ATARI BASIC Atari BASIC permits pathnames to be of limited length. You should have no problem with DOS XE pathnames. (See PATHNAMES in CHAPTER 2 for the proper uses of the colon and the < and > symbols.) If your program has file access routines, you should plan the user interface carefully to allow efficient use of subdirectories  and pathnames. It is recommended that you provide a distinct method of changing the working directory. CLEARING THE SYMBOL TABLE The tokenised form of  programs maintains a table of symbols. During program development, this table often becomes cluttered with unused or deleted variable names. A significant amount of memory may be wasted on these dead  names. Use the following procedure to remove the unused names. 1. SAVE a copy of your program. This is always a good safety procedure.. (See SAVE in this chapter.)  2. LIST an untokenised version of the program to the disk. Use a different filename. (See LIST in this chapter.) 3. Type NEW[RETURN]. This erases the copy of the program in the computers memory. 4. ENTER the untokenised version of the program. (See ENTER in this chapter.) As each line of the program is loaded it is retokenised, just as if you typed it in. A new symbol  table is built containing only the current variable names. PAGE 82 5. SAVE this new, more efficient version of your program. USING SAVE,LOAD,RUN,LIST, AND ENTER SAVE (S.) Format: SAVE PATHNAME pathname a string with the pathname of the file to which you want to SAVE your program. Examples: SAVE"D1>PROGRAMS>BASIC>FILE.BAS" SAVE NAME$ SAVE stores a tokenised program to the disk. The program is stored in the directory, with the filename, specified in the pathname. SAVEd programs can be loaded with the LOAD and RUN commands. Do not confuse this command with DOS XE SAVE MEMORY TO A BINARY FILE command. They are not compatible. LOAD (LO.) Format: LOAD PATHNAME pathname a string with the pathname of the file which contains the name of the file you want to LOAD. Examples: LOAD"D1>PROGRAMS>BASIC>FILE.BAS" LOAD NAME$ LOAD loads a tokenised program from disk. When a program is  LOADed, the program in memory is erased. LOAD only loads programs stored with the SAVE command. PAGE 83 RUN Format: RUN PATHNAME pathname a string with the pathname of the file to which contains the program you want to RUN. Examples: RUN"D1>PROGRAMS>BASIC>FILE.BAS"  RUN NAME$ RUN loads a tokenised program from a disk and runs it. When a program on a disk is RUN, the existing program in memory (if any) is erased. Run only loads and runs programs which were stored using the SAVE command. RUN can be used for chaining programs. If a program is too big for memory, it can be broken into pieces. Each piece can use RUN commands to load and run the other parts. Since RUN erases the existing part with all of its data as it loads the next, each piece must be able to stand alone. For example, a word processor might have the printing section stored in a separate file. The text in the word processor must be stored on a disk before the printing section is RUN. If the text is not stored, it will be lost. LIST (L.) Format: LIST PATHNAME pathname a string with the pathname of the file to which you want to LIST your program. Examples: LIST"D1>PROGRAMS>BASIC>FILE.BAS" LIST NAME$,100 LIST NAME$,100,2000 LIST writes an untokenised program to disk. The program is stored in the directory, with the fi lename specified in the pathname. If a starting line number is included, the file is LISTed starting from that line number. If no ending line number is included, only the starting line is LISTed. If an ! PAGE 84 ending number is included, the listing will stop after that line. LISTed files can be loaded with the ENTER command. ENTER (E.) " Format: ENTER PATHNAME pathname a string with the pathname of the file which contains the name of the file you want to LOAD. Examples: ENTER"D1>PROGRAMS>BASI#C>FILE.BAS" ENTER NAME$ ENTER loads a tokenised program from disk. Unlike LOAD and RUN, it will merge with, not erase, the existing file. If there are duplicate line number$s, the incoming lines will replace the existing lines. ENTER only loads programs stored with the LIST command. ENTER can be used for chaining programs. If a program is too big t%o fit into memory, it can be broken up into smaller pieces. With careful programming, a block of line numbers can be reserved for the pieces. Each piece must duplicate the line numbers of the others. A mast&er piece with different line numbers controls the shuffling. As each piece is brought into the program, it overwrites the piece no longer needed. All of the data are still availab'le and the program keeps running. An example of this might be a word processor in which the printing section overwrites the text editor (and vice versa). Note that the text in the word processor is preserved as you( go from one section to the other. INTERACTIVE BASIC COMMANDS The commands in this section require more information from you than the commands in the previous sec)tion do. To use them properly, you need some understanding of how DOS XE and the computer talk to each other. The Atari computer has eight communications channels, called input/ou*tput control blocks (IOCB). Each device that wants to talk to the computer must use an IOCB. PAGE 85 Only eight devices can have channels to the computer at one+ time. DOS XE needs a separate channel for each file you want to access. In order to use NOTE, POINT, PRINT, INPUT, PUT, GET, STATUS. or XIO with a file, you must open a channe,l to the file. When you finish, CLOSE the channel so that it can be used by other devices. SAVE, LOAD, RUN, LOAD, LIST, and ENTER also use an IOCB, but BASIC takes care of it automatically. - IOCBs are memory areas set up by the computer. They store the following information: *Device name (1 byte) *Device number (1 byte) *I/O co.mmand (1 byte) *The most recent status of the device (1 byte) *The buffer or filename address (2 bytes) *Put byte routine address-1 (2 bytes) *The buffer length (2 by/tes) *Auxillary control information (6 bytes) There are eight IOCBs in the Atari, numbered 0 to 7. Atari BASIC uses them as follows: *IOCB 0 for E: (the s0creen editor) *IOCB 1 for S: (screen) *IOCB 7 for SAVE, LOAD, RUN, LIST, ENTER, CSAVE, CLOAD, and LPRINT You will choose an IOCB channel each time you want to use 1 NOTE, POINT, INPUT, PRINT, PUT or GET. Choosing a channel is done with the OPEN command. Channels 1 through 5 can be used freely. Channel 6 can be used if you do not use any graphics commands. Channel 7 c2an be used if you do not use any of the commands listed for IOCB 7. Channel 0 should not PAGE 86 be used in a BASIC program. To use PRINT, PUT, IN3PUT, and GET, you must know your location in a file. DOS XE maintains a file pointer to keep track of your position. It points to the spot in the file where the next PRINT, PUT, INPUT, or GET will occur. You 4 can find the location of the file pointer with the NOTE command and change that location with the POINT command. OPEN (O.) Format: OPEN # CHANNEL,AUX1,AUX2,PATHNAME5 # Required symbol. It must always precede the channel number. channel The number of the IOCB you have chosen to use. aux61 Tells the computer what operation to perform. Possible aux1 numbers for DOS XE are: 4 INPUT. Permits you only to get information from the file in the pathnam7e. The file pointer is set to the start of the file. 5 INPUT. Like 4 above, but the file pointer is set to the end of the file. Follow with a NOTE 8 command to find the size of a file. 6 FILES LISTING. Permits you to read the directories of DOS 2.X format disks or see a DOS 2.0-like directory listing of DOS XE9 disks. 7 FILES LISTING. Permits you to read the files listing of the directory in the pathname. Shows more information than 6. : 8 OUTPUT. Lets you send information to the file in the pathname. The file pointer is set to the start of the file. CAUTION: If an existing file is OPENed for ; output, it will be erased. If you do not PAGE 87 want to erase it, use update instead 9 APPEND. Lets you add information to the e<nd of the file in the pathname. The file pointer is set to the end of the file. 12 UPDATE. Permits you to get information from and send it to th=e file in the pathname. The file pointer is set to the start of the file. 13 UPDATE. Like 12 but the pointer is set to the end of the file. > aux2 Required character. Always 0 for DOS XE disk operations. pathname String with the pathname of the file or directory you want to use. ? Examples: OPEN #2,12,0,"D1>PROGRAMS>BASIC>FILE.DAT" OPEN #N,READ,NAME$ OPEN chooses an IOCB and passes the necessary information to it. Most of this is done automatically@. You need to provide the IOCB number, the aux1 number, and the pathname of the file you want. CLOSE (C.) Format: CLOSE # CHANNEL A# Required symbol. It must always precede the channel number. channel The number of the IOCB you have chosen to close. Examples: CLOSE #2 B CLOSE #N CLOSE releases an IOCB which has been previously OPENed. It is good programming procedure to CLOSE a channel as soon as PAGE 88 you aCre through using it. CLOSEing a CLOSEd channel does not cause an error, so it is good practice to CLOSE a channel immediately before you OPEN it. THe END command CLOSEs all OPEN channels. D NOTE (NO.) Format: NOTE #CHANNEL,HIGH,LOW # Required symbol. It must always precede the channel number. channEel The number of the IOCB which you OPENed to the file. high An arithmetic variable into which DOS XE will place the two high bytes of the location. F low An arithmetic variable into which DOS XE will place the two low bytes of the location. Example: NOTE #2,HI,LO NOTE is the complement of POGINT. It returns the location of the file pointer, which specifies the location in a file where the next byte will be read or written. The location is offset from the beginning file. This is different from H DOS 2.0/2.5. (See CHANGES TO NOTE AND POINT in CHAPTER 7). The location is returned in two variables. The first is the two high bytes and the second is the low byte. The actual location can be computed with the follIowing formula: LOCATION=(256*HIGH)+LOW You will seldom use this formula. The location is generally used only with POINT, which uses the same two variables. J NOTE records the location of information within a file. As the information is written, NOTE its location. Use POINT to recover the information later. The following program sKtores information from the keyboard PAGE 89 in a disk file, D1>NOTE.DAT. It NOTEs the locations and stores them in a file called D1>POINTERS.DAT. The program accepts L up to 120 characters (three screen lines) and stores it when you press [RETURN]. 1 REM NOTE DEMO 2 REM THIS PROGRAM READS INFORMATION 3 REM FROM THE KEYBOARD AND STORES 4 RMEM IT IN THE FILE D1>NOTE.DAT. 5 REM LOCATIONS WITHIN THAT FILE ARE 6 REM NOTED AND THE POINTERS ARE 7 REM STORED IN THE FILE D1>POINTERS.DAT. 8 REM 10 REM SET THINGS UP 20 DIM INFO$(120) N 30 OPEN #1,8,0,"D1>NOTE.DAT" 40 OPEN #2,8,0,"D1>POINTERS.DAT" 50 REM GET INFO FROM KEYBOARD 60 INPUT INFO$ 70 REM IF INFO IS BLANK, THEN STOP 80 IF LEN(INFO$)=0 THEN GOTO 180 90 REM ONOTE RECORD LOCATION 100 NOTE #11,HI,LO 110 REM STORE INFO 120 PRINT #1;INFO$ 130 REM STORE POINTERS 140 PRINT #2;HI 150 PRINT #2;LO 160 REM DO IT AGAIN 170 GOTO 50 P 180 REM MARK END OF POINTERS FILE 190 PRINT #2;255 200 PRINT #2;255 210 REM GET OUT GRACEFULLY 220 CLOSE #1 230 CLOSE #2 240 END POINT (P.) Q Format: POINT # CHANNEL,HIGH,LOW # Required symbol. It must always precede the channel number. channel The number of the IOCB whichR you OPENed to the file. PAGE 90 high An arithmetic variable containing the two high bytes of the location. S low An arithmetic variable containing the two low bytes of the location. Examples: POINT #2,HI,LO POINT #3,651,23 POINTT, the complement of NOTE, moves the file pointer to a new location. The file pointer specifies the place in a file where the next byte will be read or written. The location is offset from the beginning file. U(See CHANGES TO NOTE AND POINT in CHAPTER 7. The new location is specified in two arithmetic expressions: first the two high bytes and second the low byte. The two expressioVns can be calculated from the actual location by the following formula: HIGH=INT(LOCATION/256) LOW =LOCATION-(HIGH*256) Since the location speWcified by POINT is often identified by NOTE (which uses the same variables), you will not need the formulae in those cases. In some applications, such as files with fixed length records, you may use the formulae X extensively. The following program retrieves information stored by the sample program for NOTE. It recovers the locations stored in D1>POINTERS.DAT and uses them to get the information inY D1>NOTE.DAT. The information is printed on screen. 1 REM POINT DEMO 2 REM THIS PROGRAM RETRIEVES THE 3 REM INFORMATION STORED IN THE NOTE 4 REM DEMO. IT RETRIEVES THE LOCATIONSZ 5 REM FROM FILE D1>POINTERS.DAT AND 6 REM USES THEM TO RETRIEVE THE INFO 7 REM FROM THE FILE D1>NOTE.DAT 8 REM 10 REM SET THINGS UP 20 DIM INFO$(120),P(100,1):I=0 30 OPEN #1,4,0,"D[1>NOTE.DAT 40 OPEN #2,4,0,"D1>POINTERS.DAT PAGE 91 50 REM READ IN POINTERS 60 INPUT #2,HI,LO 70 REM IF ITS THE END OF FILE,GO TO NEXT STEP 80 IF HI=255 \AND LO=255 THEN GOTO 140 90 REM PUT POINTERS IN THE ARRAY 100 P(I,0)=HI:(I,1)=LO 110 REM DO IT AGAIN 120 I=I+1 130 GOTO 50 140 REM GEM NUMBER FROM KEYBOARD 150 TRAP 250 1]60 INPUT N:N=N-1 170 REM GET POINTERS 180 HI=P(N,0):LO=P(N,1) 190 REM GET INFO 200 POINT #1,HI,LO 210 INPUT #1,INFO$ 220 PRINT INFO$ 230 REM DO IT AGAIN 240 GOTO 140 ^ 250 REM GET OUT GRACEFULLY 260 CLOSE #1 270 CLOSE #2 280 END The following sample program shows how to calculate the POINT values to retrieve fixed length records. It_ assumes the records are all 134 bytes long. NOTE: This sample program will not run by itself. You must first create the SAMPLE.DAT file. 1 REM POINT DEMO` 2 2 REM PROGRAM TO RETRIEVE 134 BYTES 3 REM FIXED LENGTH RECORDS FROM A 4 REM FILE NAMED "SAMPLE.DAT" 5 REM 10 REM SET THINGS UP 20 DIM RECORDS$(134) 30 OPEN #1,4,0,"D>SAMPLE.DAT"a 40 REM GET THE RECORD NUMBER 50 PRINT "Which record do you want"; 60 INPUT NUMBER 70 REM CALCULATE POINT VALUES 80 OFFSET=NUMBER*134 90 HIGH=INT(OFFSET/256) 100 LOW=OFFSET-(HIGH*2b56) 110 REM GET THE RECORD 120 POINT #1,HIGH,LOW 130 INPUT #1,RECORD$ PAGE 92 140 PRINT RECORD$ 150 REM GET OUT GRACEFULLY 160 CLOSE 31 c 170 END PRINT (PR. or ?) Format: PRINT #CHANNEL[[;]EXPRESSION] # Required symbol. It must always precede the channel dnumber. channel The number of the IOCB which you OPENed to the file. Separator, required if there is an expression. If a comma is eused instead of the semicolon, a number of spaces (determined by the TAB value) are inserted. expression String or arithmetic, if no expression is given, ofnly an [EOL] is sent. If additional expressions are given, they will be joined (concatenated). Examples: PRINT #3,NUM PRINT #2;A$,B$;C$ g ?#4;X,"SAMPLE"; PRINT is the complement of INPUT. It is used with line orientated data. Lines are terminated by an end of line character (EOL=155,$9B). They may be single numbers orh strings. Although there is no limit to the size of PRINT data, INPUT data are limited to 255 characters and INPUT data longer than 127 characters overwrite part of page six, possibly ais much as $0600 to $067F. It is wise to restrict the length of data which must be INPUTed later. Multiple expressions can be stored in the same PRINT command, but they will be jjoined (concatenated). Multiple strings are concatenated into one string. Multiple numbers are joined end to end; for example, 5 and 26 become 526. PAGE 93 This makes mukltiple numbers in a PRINT command impractical. If the separators between expressions are semicolons, the expressions are concatenated directly. For example, abc and def become abcdef. l If the separators are commas, a number of spaces, determined by the TAB value, are inserted between the expressions. For example, abc and def would become abc def. m If the expression in a PRINT command does not end with an EOL, one is added. There is an exception if the last expression is followed by a semicolon or a comma. In that case the EOL is supressned. Use one PRINT # for each data item that is sent to a file. 1 REM PRINT DEMO 2 REM THIS PROGRAM PRINTS INFORMATION 3 REM TO A DATA FILE NAMED 4 REM D1>PRoINT.DAT 5 REM 10 REM SET THINGS UP 20 OPEN #1,8,0,"D1>PRINT.DAT" 30 PRINT #1;"First a sentence." 40 PRINT #1;"Now a number:" 50 PRINT #!;125 60 REM CLOSE THINGS UP AND STOP p 70 CLOSE #1 80 END INPUT (I.) Format: INPUT #CHANNEL,VARIABLE[,VARIABLE] # Required symbol. It must always precede the q channel number. channel The number of the IOCB which you OPENed to the file. , OR ; Required separator. r PAGE 94 variable String or arithmetic, it should match the type of the incoming data. Additional variables may be used to get additional data. Variables must s be separated by commas. Examples: INPUT #3,INFO$ INPUT #2;X,Y,Z INPUT #4;X,INFO$ INPUT is the complement of PRINT. It is used witth line orientated data. Lines are terminated by an end of line character (EOL=155,$9B). They may be single numbers or strings. INPUT data longer than 127 characters overwrite the first 128 bytues of page six (memory locations 1536-1663,$0600-$067F). THe first variable is separated from the channel by a comma or semicolon. You can get more than one livne with an INPUT command. Use additional variables for the additional lines. Each type of variable must match the type of incoming data. The additional variables are always separated by commas. w 1 REM INPUT DEMO 2 REM THIS PROGRAM INPUTS INFORMATION 3 REM FROM THE FILE NAMED D1>PRINT.DAT 4 REM (WHICH WAS CREATED BY THE PRINT 5 REM DEMO) AND PRINTS IT TO THE SCREEN 6 REM x 10 REM SET THINGS UP 20 DIM INFO1$(20),INFO2$(20) 30 OPEN #1,4,0,"D1>PRINT.DAT" 40 REM INPUT EACH PIECE OF INFORMATION 50 INPUT #1,INFO1$ 60 INPUT #1,INFO2$ 70 INPUT #1,X 80 REMy PRINT THEM TO THE SCREEN 90 PRINT INFO1$ 100 PRINT INFO2$ 110 PRINT X 120 REM CLOSE THINGS UP AND STOP 130 CLOSE #1 140 END PUT (PU.) z PAGE 95 Format: PUT #CHANNEL,BYTE # Required symbol. It must always precede the channel number. {channel The number of the IOCB which you OPENed to the file. byte An expression that evaluates to a single byte. Examples: PUT #3,ASC("A") | PUT #2,PEEK(764) PUT is used to send a single byte to the disk. 1 REM PUT DEMO 2 REM THIS PROGRAM PUTS SINGLE BYTES 3 REM OF INFORMATION TO A DATA FILE } 4 REM NAMED D1>PUT.DAT 5 REM 10 REM SET THINGS UP 20 OPEN #1,8,0,"D1>PUT.DAT" 30 REM PUT TWO BYTES TO THE FILE 40 PUT #1,125 50 PUT #1,ASC("A") 60 REM CLOSE THINGS UP AND STOP ~ 70 CLOSE #1 80 END GET (GE.) Format: GET #CHANNEL,VARIABLE # Required symbol. It must always precede the  channel number. channel The number of the IOCB which you OPENed to the file. variable An arithmetic variable that receives the byte. Example: GET #3,X PAGE 96 GET is used to get a single byte from the disk. 1 REM GET DEMO 2 REM THIS PROGRAM GETS SINGLE BYTES  3 REM OF INFORMATION FROM THE DATA 4 REM FILE NAMED D1>PUT.DAT (WHICH WAS 5 REM CREATED BY THE PUT DEMO) AND 6 REM DISPLAYS THEM ON THE SCREEN 7 REM 10 REM SET THINGS UP 20 OPEN #1,4,0,"D1>PUT.DAT" 30 REM GET TWO BYTES FROM THE FILE 40 GET #1,X 50 GET #1,Y 60 REM PRINT THEM TO THE SCREEN 70 PRINT X 80 PRINT CHR$(Y) 90 REM CLOSE THINGS UP AND STOP 100 CLOSE #1 110 END STATUS (ST.) Format: STATUS #CHANNEL,VARIABLE # Required symbol. It must always precede the channel number. channel The number of the IOCB which you OPENed to the file. variable An arithmetic variable which will receive the status number. Example: STATUS #2,ERROR The STATUS command is used to determine the condition of a file. It checks for several ways an error might occur. It checks for the following disk errors: Sector Buffer available? If no, then ERROR=161 Legal device number? If no, then ERROR=20 Legal pathname? If no, then ERROR=170  PAGE 97 File on diskette? If no, then ERROR=170 File locked? If yes, then ERROR=167 The STATUS command also checks for the following serial bus errors: Device timeout ERROR=138 Device not acknowledging ERROR=139 Serial bus error ERROR=140 Serial bus data frame overrun ERROR=141 Serial bus checksum error ERROR=142 Device done error ERROR=144 BASIC does not allow you to use a filename with the STATUS command. It is strongly recommended that you use the XIO 13 command which allows filenames instead. XIO (X.) Format: XIO COMMAND,#CHANNEL,AUX1,AUX2,INFO command XIO command number. # Required symbol. It must always precede the channel number. channel The number of the IOCB which you OPENed to the file. aux1 Auxiliary information number, 0 except for OPEN and INITIALIZE DISK. aux2 Auxiliary information number, always 0 with DOS XE. info String containing information required by the individual XIO command. Example: XIO 33,#2,0,0,"D1>TEMP.BAS" The XIO command is an extended input/output statement used PAGE 98 for special operations. It can be used when you want to perform some of the functions that would otherwise be performed using the DOS XE menu options. COMMAND OPERATION FORMAT 13 STATUS XIO 13,#Channel,0,0,pathname 32 RENAME XIO 32,#Channel,0,0,pathname,new filename (do not use path in new name, e.g., XIO 32,#2,0,0,  "D>PATH>FILENAME.EXT,NEWNAME.EXT") 33 ERASE FILE XIO 33,#Channel,0,0,pathname 35 PROTECT XIO 35,#Channel,0,0,pathname 36 UNPROTECT XIO 36,#Channel,0,0,pathname 37 NOTE XIO 37,#Channel,0,0,pathname 38 POINT XIO 38,#Channel,0,0,pathname 42 NEW XIO 42,#Channel,0,0,pathname DIRECTORY 43 DELETE XIO 43,#Channel,0,0,pathname DIRECTORY 44 WORKING XIO 44,#Channel,0,0,pathname DIRECTORY 252 INITIALIZE  XIO 252,#Channel,0,0,drive type DISK Drive types are the same ones available in the INITIALIZE DISK option. In a standard configuration,  that would be: AT810 (Atari 810 drive) AT1051 (Atari 1050 drive) XF551 (Atari XF551 drive) 130RAM  (RAMdisk on an Atari 130XE) SSDD (5.25 inch single sided, double density) 253 INITIALIZE XIO 253,#Channel,drive,0,drive number DISK (Example:XIO 253,#2,3,0,"D2:") If drive=0, AT810 is used. Otherwise, drive type is the position in the  Drive Table (DT). In a standard configuration, that would be: 1 AT810 PAGE 99 2 AT1050  3 XF551 4 130RAM 5 SSDD 254 INITIALIZE XIO 254,#Channel,0,0,drive number DISK (Example:XIO 254,#2,0,0,"D2:") Initialise disk in current format of disk drive. Caution-uses the format that the drive thinks it is, not necessarily the same as what DOS XE thinks it is. The following is a mini-DOS program that lets you manipulate your disk files from BASIC. 1 REM Mini DOS to access DOS XE 2 REM functions directly from 3 REM BASIC using XIO commands 4 REM 10 REM Set things up 20 DIM FILE$(80),NAME$(20) 30 REM Menu 40 GRAPHICS 0:PRINT :PRINT ,"Mini-DOS":PRINT 50 PRINT "(1)DIRECTORY LISTING" 60 PRINT "(2)CHANGE WORKING DIRECTORY" 70 PRINT "(3)RENAME A FILE" 80 PRINT "(4)ERASE A FILE" 90 PRINT "(5)UNPROTECT A FILE" 100 PRINT "(6)PROTECT A FILE"  110 PRINT "(7)CREATE A NEW DIRECTORY" 120 PRINT "(8)INITIALIZE A DISK" 130 PRINT "(9)DELETE A DIRECTORY" 140 PRINT :PRINT "Enter a number (1)-(9)" 150 INPUT N 160 IF N<1 OR >9 THEN GOTO 40  170 GRAPHICS 0:PRINT :PRINT : PRINT 180 ON N GOSUB 200,300,400,500,600,700,800,900,1100 190 GOTO 40 200 REM Get a Directory Listing 210 TRAP 260 220 OPEN #1,7,0,"D:*.*" 230 INPUT #1,FILE$ 240 PRINT FILE$ 250 GOTO 230 260 CLOSE #1 270 PRINT :PRINT "Press RETURN" 280 INPUT FILE$ 290 RETURN 300 REM New Working Directory 310 PRINT "What is the new Pathname" 320 INPUT FILE$ 330 XIO 44,#1,0,0,FILE$ PAGE 100 340 RETURN 400 REM RENAME a file 410 PRINT "Which file do you want to RENAME" 420 PRINT "(include Pathname)" 430 INPUT FILE$ 440 PRINT :PRINT :PRINT "What is the new Filename" 450 PRINT "(do not include Pathname) 460 INPUT NAME$ 470 FILE$(LEN(FILE$)+1)="," 480 FILE$(LEN(FILE$)+1)=NAME$ 490 XIO 32,#1,0,0,FILE$:RETURN 500 REM ERASE a file 510 PRINT "Which file do you want to ERASE" 520 PRINT "(include Pathname) 530 INPUT FILE$ 540 PRINT :PRINT :PRINT "Are you sure you want to" 550 PRINT "ERASE";:PRINT FILE$;"(Y/N)" 560 INPUT NAME$ 570 IF NAME$(1,1)<>"Y" THEN RETURN 580 XIO 33,#1,0,0,FILE$ 590 RETURN 600 REM UNPROTECT a file 610 PRINT "Which file do you want to UNPROTECT" 620 PRINT "(include Pathname)" 630 INPUT FILE$ 640 XIO 36,#1,0,0,FILE$ 650 RETURN 700 REM PROTECT a file 710 PRINT "Which file do you want to PROTECT" 720 PRINT "(include Pathname)" 730 INPUT FILE$ 740 XIO 35,#1,0,0,FILE$ 750 RETURN 800 REM Create a new directory 810 PRINT "What's the name of your new directory" 820 PRINT "(include Pathname)" 830 INPUT FILE$ 840 XIO 42,#1,0,0,FILE$ 850 RETURN 900 REM INITIALIZE a disk 910 PRINT "INITIALIZE a disk on which drive" 920 INPUT X 930 IF X<1 OR X>8 THE GOTO 920 940 FILE$="D":FILE$(LEN(FILE$)+1)=STR$(X):FILE$(L EN(FILE$)+1)=":" 950 PRINT "INITIALIZE disk drive";FILE$ 960 PRINT "in which format":PRINT 970 PRINT "(1)AT810" 980 PRINT "(2)AT1050" 990 PRINT "(3)XF551" 1000 PRINT "(4)130XE RAM disk" 1010 INPUT N 1020 IF N<1 OR N>4 THEN GOTO 990 1030 PRINT "INITIALIZing disk will erase it" PAGE 101 1040 PRINT "Are you sure you want to go ahead (Y/N)" 1050 INPUT NAME$ 1060 IF NAME$(1,1)<>"Y" THEN RETURN 1070 XIO 253,#1,N,0,FILE$ 1080 RETURN 1100 REM DELETE a directory 1110 PRINT "Which directory do you want to DELETE" 1120 PRINT "(include Pathname) 1130 INPUT FILE$ 1140 XIO 43,#1,0,0,FILE$ 1150 RETURN PAGE 102