CONVERT PROGRAM Advan BASIC is a fast, powerful, efficient BASIC which takes advantage of ATARI'S excellent graphics and sound capabilities. Thus, if you are planning fo write a new BASIC program for the ATARI, you will normally get a faster and better program using Advan BASIC rather than ATARI BASIC. However, any Advan owners might want to use Advan to speed up existing ATARI BASIC programs which they have written. Since Advan BASIC cannot directly load and run these programs, they either need to be rewritten or converted. If you want to take fu1l advantage of Advan's speed and power, the best approach is to rewrite these programs following the same general program outline but using the full range of Advan commands. If you want to try to speed up your program without rewriting, however, we have added to our package a convert program which will convert many (but by no means all) ATARI programs to Advan format. Note that it is not always an advantage to speed up a program. For example a game might become too fast to play, or sounds may no longer sound right. To use the convert program you must be in Advan BASIC. Insert a disk with CONVERT.COD into drive 1. This program along with CONVERT.SUB is on the Master disk. You can use a Master disk or you can use COPYFILE.COD to transfer one or both programs to another disk and use that disk (see Ch. 17 of. the Advan BASIC manual). Now type EXEC CONVERT.COD. First, you are asked for the name of the ATARI program. This program should have been saved to a disk using the SAVE command while in ATARI BASIC. Insert the disk with the program and then enter the name. Then you are asked for the name of the Advan program to be created; enter that name. Next you are given the opportunity to change one or more of the variables used in your program from real to integer. (For advantages of integers see Ch.2 of manual.) A list of the variables is displayed. If the variable represents a real array, it will have a period inserted into the name. To change all real variables to integers, type % and then press RETURN. To change one variable, type the variable name and press RETURN. The variable will be changed and the list displayed again, allowing you to make another change. When you have switched all the variables you desire to integer form, press RETURN and the conversion will begin. Ready is displayed when the conversion is completed. Now insert a disk with CONVERT.SUB on it and type LOAD CONVERT.SUB. This loads the subroutines required to handle the differences in the BASICs. Next reinsert the disk with the Advan form of the program and type APPEND followed by the name you gave to the Advan program. When the APPEND is completed type COMPILE 1. At the cornpletion of the compile type SAVEC followed by the name you used for the Advan program. This will place the compiled code on the disk. You can now execute the program by typing EXEC followed by the Advan program name. As an example assume that the following ATARI BASIC program has been saved using the name ALPHA: 10 FOR T=1 T0 1000:S=S+T:NEXT T:? S:END The following sequence will produce a program called BETA which Advan BASIC can run. Note that you ust be in Advan BASIC and that what you type is underlined and what the computer displays is not. Comments are in parentheses. EXEC CONVERT.COD (Disk with CONVERT.COD must be in drive 1) Enter ATARI program name ALPHA (Insert disk with program before pressint RETURN) Enter Advan program name BETA T S (A11 the variables used in the program are listed) Enter name to change var. to int. Enter % to change all real to int. Press RETURN when done (In this program we do not want to convert either variable to integer so press RETURN) Ready (Advan program named BETA is now on disk) LOAD CONVERT.SUB (Disk with CONVERT.SUB must be in drive 1) Ready APPEND BETA (Insert disk with BETA before pressing RETURN) Ready COMPILE 1 SAVEC BETA EXEC BETA (This executes the converted program) Some programs are so long that the above sequence won't work and you will get a NO ROOM error. For many of these programs the following sequence will work. Proceed as above through the LOAD CONVERT.SUB command and then: SAVE CONVERT.SUB (Insert disk with BETA before pressing RETURN) Ready LOAD CONVERT.SUB 1 Ready APPEND BETA Ready SAVE BETA Ready COMPILE BETA/BETA.COD Ready KILL BETA EXEC BETA.COD (This executes the converted program) The ATARI commands USR, FRE, PADDLE, STATUS, NOT, PTRIG, and LIST cannot be converted and so any program using them will need to be modified before conversion. In ATART BASIC the POP command can be used to remove information on the last GOSUB or to remove FOR loop data. The former use of POP is supported. The latter is neither supported nor needed. When a POP is encountered by the convert program, the line number will be listed so that you can check it. If it is used for FOR loop data you will need to remove the POP command from the ATARI BASIC program. Of the XIO commands only the special fill command (i.e., #18) is supported. In ATARI BASIC you can use a variable to set the dimension of an array or the length of a string. When the DIM statement is executed the value of the variable determines the dimension used. In Advan BASIC this is not possible. The convert program will attempt to determine the value of the variable. If it cannot, the dimension will be set to 100 which is usually large enough. In either case the program will list the line number, the name of the variable being dimensioned, and the value that the dimension has been set to. If the value is not appropriate you will need to change the ATARI program. ATARI BASIC also permits variables to be used for the line numbers in GOTO and GOSUB statements. This would be difficult for any compiler to support and Advan does not. Again the convert program will attempt to determine the value of the variable. It will list the line number and the value used or give an error if it cannot determine a va1ue. Also some of the programming tricks used in ATARI BASIC will give an error in Advan BASIC. For example, if you put NEXT statements in IF commands you can use several NEXT statements with each FOR. This will give an error in Advan BASIC and you will need to modify the program before it can be converted. Note that if you are using player missiles you might have to add 64 to the number used in the GRAPHICS commands.