RESEARCH MACHINES RELEASE NOTE PN 12763 Revision 1 August 1984 Extended BASIC for Stand-alone 480Z Disc Systems and Chain Network Systems This release note gives information about the two versions of the BASIC interpreter on the distribution discs supplied with your stand-alone 480Z disc system, with your Chain network system, or with your upgrade kit. Also, there is information about running the demonstration programs supplied on these discs as well as other important information. CONTENTS OF THIS RELEASE NOTE o Configuration of the two versions of BASIC. o Where the files are held (stand-alone 480Z disc systems). o Where the files are held (network release 2.0 and later, double- density). o Where the files are held (networks prior to release 2.0, single- density). o How to run the demonstration programs. o Manual to be used with these versions of BASIC. o Memory requirements for the three configurations of each BASIC interpreter. o Adding machine-language routines. 1 Configurations of the two Versions of BASIC The version numbers of the two interpreters supplied to you are: o Extended BASIC, Version 6.3B* o Extended BASIC, Version 5.3G The BASIC6 interpreter has more facilities and uses more memory space than the BASIC5 interpreter. Consequently, you have the choice of running more advanced programs with BASIC6, or less advanced but larger programs with BASIC5. For each interpreter there are three configurations; each configuration contains a different level of high resolution graphics and needs a different amount of memory: o BASIC6.COM - Extended BASIC, Version 6.3B* without high resolution graphics. o BASIC6G.COM - Extended BASIC, Version 6.3B* with level 1 high resolution graphics. o BASIC6G2.COM - Extended BASIC, Version 6.3B* with level 2 high resolution graphics. o BASICS.COM - Extended BASIC, Version 5.3G without high resolution graphics. o BASICSG.COM - Extended BASIC, Version 5.3G with level 1 high resolution graphics. o BASICSG2.COM - Extended BASIC, Version 5.3G with level 2 high resolution graphics. The memory requirements for these configurations are given in a later section of this release note. Where the Files are Held (Stand-alone 480Z Disc Systems) Your 5.25-inch, double-density master system disc contains all six configurations of the interpreters on the reverse side (side C). The level 2 high resolution graphics configuration of BASIC6 (a file called BASIC.COM) is also present on the first side (side A). The 5.25-inch, double-density welcome disc contains a copy of the BASICSG2.COM file on its first side (side A). 2 Where the Files are Held (Release 2.0 and later Networks, double-density) All six configurations of the interpreters are contained on the reverse side (side C) of your BASIC distribution disc. The first side (side A) contains a file, BASIC.COM (BASIC 6.3B* with level 2 high resolution graphics), and a number of example programs. If you have just received a new network: o In non-winchester systems, your network server disc contains a copy of the BASICSG2.COM file and a demonstration file (DEMO.BAS) on its first side (Side A). o In winchester systems, your network server disc contains the BASICSG2.COM and DEMO.BAS files on side A. In addition there are copies of these files on side A of your winchester maintenance disc. Where the Files are Held (Networks prior to Release 2.0, single-density) All six configurations of the two interpreters are contained on the BASIC distribution disc. If you have 5.25-inch system, the configurations are distributed on both sides of the disc. No demonstration programs are provided with this system. If you have an 8-inch system, all six configurations are on side A of disc. In addition, there is a BASIC.COM file (BASIC 6.3B* with level 2 high resolution graphics) and a small number of demonstration programs on side A. How To Run Demonstration Programs If you have a stand-alone 480Z disc system, your welcome disc contains some demonstration programs that can be run by following the instructions on page 4.3 of the manual: Link 480Z Disc System Users Guide. Purchasers of a new 480Z disc system can also run a demonstration program held on the master distribution disc. This is in the file called MEMBER.BAS on side C of the disc. Assuming that you are logged on to side C, enter: BASIC6 MEMBER and a random access file program will run. If you have a Chain network system, your BASIC distribution disc contains some demonstration programs (not 5.25-inch, single-density systems). To find out how to load the CP/NOS operating system and run programs, consult the manual: Network Release 2.1 Users Guide. 3 To run the demonstration programs, ensure that your BASIC disc is in the correct logical drive, and enter at your station: BASIC START The demonstration programs will now start running. Each program will start automatically when the previous one has finished. If you want to interrupt a program and move to the next one, enter . Manual to be used with these Versions of BASIC You will have been supplied with the BASIC manual: Extended BASIC Versions 5 & 6 for Disc and Network Systems Reference Manual, PN 11006. The descriptions of those features and commands of Extended BASIC, Version 6 that are not implemented in Extended BASIC, Version 5 are shown in half tone. Some points should be noted: BASIC 5 and 6 1) Saving files in internal format Having saved a program in internal format (with FSAVE), reloading it using a version with different graphics support will give problems. The program will not run or list correctly. If this does happen, change to the version that you were using when you saved the program, reload the program, and save it with the SAVE command. Also, when editing a program saved in internal format, edited lines or newly entered lines may appear at the end of the program on listing, rather than in the correct sequence. In this case, the program will not execute correctly. To overcome this, save the program with the SAVE command, then reload it. 2) The RENAME command This command gives the wrong error message ("Write Error") when it cannot find the file to be renamed. The message should be "File Not Found". 4 BASIC 5 ONLY If you have an Anadex printer attached to your 480Z or network, there is a problem with the facility (printer echo) that produces output to both screen and printer. With an Anadex printer, the output is in condensed typeface. If you do not want condensed typeface, use the LPRINT command instead of the printer echo facility. BASIC 6 ONLY There are points concerning functions, random access files, and the RENUMBER command. 1) Functions o If you try to return a string from a numeric function, or vice versa, no type mismatch error is given and unpredictable results can be obtained. o consider an expression that includes array references and function calls, such as: W$(I) = W$(I) + FN RN$() If a new variable is created inside the function, the returned value from the expression will not be the expected one. To avoid this problem, you can do the evaluation in two or more stages to avoid mixing array references and function calls. Or you can ensure that no new variables are created inside the function; do this by initializing the variables before calling the function. Array elements perform correctly if passed as arguments to the function. o If you have a program that contains a statement like this: A = FNA(FNB()) a "type mismatch" error will be given on return from function FNA. The error occurs only if FNB has no arguments. This problem can be solved by using two statements instead of one: T = FNB() A = FNA(T) 2) Random access files o When using random access files in lock mode on a Chain network, it is possible for an error to occur during an open operation. 5 For example, a station may receive the error message: File locked when this happens, other stations cannot access that file, unless they are in lock mode. To allow access by stations that are not in lock mode, a RESET command should be issued. o If you try to open a random access file when in read mode, and if that file does not exist, an error message is displayed: File open for reading only even though the file does not exist. o If you try to open a random access file on a channel containing another open file, problems can occur. Wherever possible, close a file before opening another one. Peculiar effects will occur if you open any files on channel 34. 3) The RENUMBER command If you use the RENUMBER command more than once, incorrect errors will be reported. To avoid problems, save your program and restart BASIC before a second renumbering exercise. 6 Memory Requirements of the three Configurations of each BASIC Interpreter Below are details of memory requirements of the versions of BASIC provided: BASIC6 File name BASIC6.COM BASIC version 6.3B* Start address 100 Restart address 103 Memory address limits 100 - 5221 hex BASIC6G File name BASIC6G.COM BASIC version 6.3B* HRG (level 1) version 2.0 D Start address 100 Restart address 103 Memory address limits 100 - 5E43 hex BASIC6G2 File name BASIC6G2.COM BASIC version 6.3B* HRG (level 2) version 1.1 Z Start address 100 Restart address 103 Memory address limits 100 - 6D3F hex BASICS File name BASICS.COM BASIC version 5.3G Start address 100 Restart address 103 Memory address limits 100 - 3805 hex BASICSG File name BASICSG.COM BASIC version 5.3G HRG (level 1) version 2.0 B Start address 100 Restart address 103 Memory address limits 100 - 4416 hex BASICSG2 File name BASICSG2.COM BASIC version 5.3G HRG (level 2) version 1.1 J Start address 100 Restart address 103 Memory address limits 100 - 5312 hex 7 Adding Machine-Language Routines The start of BASIC contains a number of jumps and vectors. These will be of interest if you wish to add machine-language routines to the interpreter. This listing contains the values of all the symbolic locations mentioned in chapter 18 of the Extended BASIC, Versions 5 & 6 manual. The addresses of the routines themselves will vary from version to version, and are represented here as zeros. 0100 C30000 0165 BASIC: JP INIT ;INITIALIZE ENTRY POINT 0103 C30000 0167 REST: JP ERR.RC ;RECOVERY ENTRY POINT 0106 C30000 0167 USR: JP ERR.FC ;USR DEFINED JUMP 0109 C30000 0168 USRVF: JP CVRLIN ;USR SUBROUTINE TO GET VAR 010C C30000 0169 USRVT: JP CS 16R2 ;USR SUBROUTINE TO PASS VAR 010F C30000 0170 SAVVAR: JP SAVINT ;SAVE INTEGER IN VAR 0112 C30000 0171 OUTMX: JP .OUTM ;PRINT MESSAGE 0115 CD0000 0172 E.ERR: CALL ER.EXT ;EXTERNAL ERROR 0118 0000 0173 BBUFV: DEFW ENDIT ;END OF BASIC 011A 0000 0174 SUBPTR: DEFW 0 ;POINTER TO SUBS 011C 0000 0175 ENDMEM: DEFW 0 ;END OF MEMORY 011E 0000 0176 BRFCB: DEFW RFCB ;READ FCB 0120 0000 0177 BWFCB DEFW WFCB ;WRITE FCB 0122 424153 0178 DEFEXT: DEFM 'BAS' ;DEFAULT EXTENSION 0125 C9 0179 INITSUB: RET ;USER INITIALISATION VECTOR 0126 00 0180 NOP 0127 00 0181 NOP 0128 000000 0182 CH.INPUT: CALL CHARIN ;GET BYTE FROM SPECIFIED ;INPUT CHANNEL 012B 000000 0183 CH.OUTPUT: CALL CHAROUT ;PUT BYTE TO SPECIFIED It should be noted that CH.INPUT and CH.OUTPUT did not exist in previous versions of Extended BASIC, Version 5. 8