B A S I C C O M P I L E R P A T C H E S ********************************************************** *** This information was derived from the IBM PCSS *** *** system in BOCA RATON, FL *** *** *** *** Origional file from the Charlotte, NC PC-BBS *** *** 1200/300 N/8/1 (704) 365-4311 *** ********************************************************** These patches are provided to fix the following known bugs with the IBM Basic Compiler. 1. The use of CHAIN with COMMON from a large program to a small program, both with large data areas can cause an "Out of MEMORY Error" 2. The use of INPUT# with quotes strings of length 1 may produce random results. 3. When using array calculations such as: T(J,L)=G(J)*E(L)+T(J+1,T) an internal error may result. 4. MOD does not return the correct value under certain conditions. 5. When using several LEFT$, RIGHT$ or MID$'s in string calculations, a "string formula too complex" error is received. 6. COMMUNICATION Buffers are destroyed when CHAINing to another program. 7. BLOAD may fail with an "input past end". APPLY THESE PATCHES USING DOS 1.1 ONLY!!! ----------------------------------------- AH0015 Basic Compiler Patches - #1 of 7 Sept 1, 1983 Following is the complete set of Basic Compiler Patches. for version 1.0. These will be updated as needed, the date will be in the first line of the text. Before starting, boot up DOS 1.1 on your machine. These patches can not be installed properly with any other version of DOS. Use DOS 1.1 throughout the procedure. If you are faZ}1%I5Rt%Q!"UJTU $Z willlttake you approximately 1/2 to 3/4 hour to install these patches. Be certain that you are using a back-up diskette, not the originals. We all make mistakes, and it is MUCH easier to start over with another diskette than to try to reconstruct damaged data. When you are done, be sure to note on the label that these diskettes have been patched, and the date the patch was installed. ============================================================ UPDATE PROCEDURE The following is a "script" of the procedure to update your BASIC Compiler Library and Basic diskettes. Follow it carefully. If you make a mistake don't panic, just start again. First, you will make an exact copy of your BASIC Compiler Library and Basic diskettes using the DOS DISKCOPY command. You need two blank formatted diskettes. Put your DOS diskette in Drive A and a blank formatted diskette in Drive B. ALL YOUR INPUTS ARE IN <>'s, as in . Do NOT type the <>'s. A> This command will send the following messages to the screen: Insert source diskette in drive A: Insert target diskette in drive B: Strike any key when ready You must insert the MASTER copy of the BASIC Compiler Library diskette in drive A. Anything else will NOT work. This is your source diskette. You must insert the BLANK FORMATTED diskette in drive B. (This is your target diskette.) Press the enter key to start the disk copy. The following message will appear on the screen: Copy another (Y/N)? The following message will appear on the screen: Insert source diskette in drive A: Insert target diskette in drive B: Strike any key when ready Remove your Master Library diskette from drive A and your copy from drive B. Label your copy "BASIC COMPILER LIBRARY DISKETTE - UPDATED WORKING COPY". Insert your Basic Compiler Basic diskette in drive A, and your second formatted blank diskette in drive B. Strike the return key to start the copy. The following message will appear on the screen: Copy another (Y/N)? Remove your Master Basic diskette from drive A and your copy from drive B. Label your copy "BASIC COMPILER BASIC DISKETTE - UPDATED WORKING COPY". Place your DOS diskette back in drive A. ========== USING DEBUG TO UPDATE YOUR DISKETTE ============= The DEBUG prompt is "-". Everything that you type will be after the "-" or after the ".". Immediately after entering the hex digits following the "." prompts, you must press the space bar to move to the next byte. The places that you must press the ENTER key are indicated by . Note that the "xxxx" in the data displayed will be filled with the appropriate memory address. ************************************************************ ****** * * * * * * * 1 * * * * * * * ******* ************************************************************ ==================== PROBLEM DESCRIPTION =================== The use of CHAIN with COMMON when CHAINing from a large program with a large data area to a small program with a large data area may produce an incorrect 'Out of memory' error. ====================== PROBLEM SOLUTION ==================== UPDATING BASRUN.EXE The following procedure will update the file BASRUN.EXE. Remember that the DOS diskette should be in drive A and the diskette labeled "BASIC COMPILER LIBRARY - UPDATED WORKING COPY" should be in drive B. If at any time you do not see the data exactly as it appears on this procedure, (ignore (cont'd)s) you did something wrong and you should start again. You can start again by typing Q followed by ENTER. This returns you to DOS. Be certain that you are on drive B:; you should see a B> prompt. If you see anything else then type B: to switch to your B: drive. B> - AX=0000 BX=0000 CX=79AA DX=0000 SP=0000 BP=0000 SI=0000 (cont'd) DI=0000 DS=04B5 ES=04B5 SS=04C5 CS=057B IP=0000 NV UP DI PL NZ NA (cont'd) PO NC 057B:0000 1E PUSH DS - B> In the listing above, notice that the value of CS=057B. This is the value that will be used in the next step. Since CS=057B, the command that is used with Debug is: E57B:0CF1 The value of the CS register is always used with this command, it is not NECESSARILY going to be 057B. B> - xxxx:0CF1 3B.<72> C1.<09> 77.<3B> 03. E9.<77> CA.<05> (cont'd) FB. xxxx:0CF8 A3. 7A. 07.<00> 0B.<00> FF. 74.<7A> (cont'd) 38.<07> - Writing 7C00 bytes - Leave your Working Library diskette in drive B, and your DOS 1.1 diskette in drive A: for the following update installation. CONTINUE TO #2 AH0016 Basic Compiler Patches - #2 of 7 ************************************************************ ****** * * * * * * * 2 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== The use of the INPUT# statement with quoted strings of length 1 may produce random results. ====================== PROBLEM SOLUTION ==================== Use the procedure described below to update your IBM Personal Computer BASIC Compiler. UPDATING BASRUN.EXE B> - xxxx:6236 3C. 22. xxxx:6238 75.<3C> 10.<22> 80.<75> FA.<10> 2C.<80> 75. (cont'd) 0B.<2C> E8.<75> xxxx:6240 7E.<0B> 00. BA.<7C> 22.<00> 22. E8.<22> (cont'd) 48.<22> D4. xxxx:6248 72.<46> 40. B1.<72> FF.<3E> - Writing 7C00 bytes - B> UPDATING BASCOM.LIB: The following procedure will update the file BASCOM.LIB. Remember that the DOS diskette should be in drive A and the disk labeled "BASIC COMPILER LIBRARY DISKETTE - UPDATED WORKING COPY" should be in drive B. If at any time you do not see the data exactly as it appears on this procedure, you did something wrong and you should start again. You can start again by typing Q followed by ENTER. This returns you to DOS. B>ZKECBD7> -xxxx:CBD7 3C. -xxxx:CBD8 22. 75.<3C> 10.<22> 80.<75> FA.<10> 2C.<80> (cont'd) 75. 0B.<2C> -xxxx:CBE0 E8.<75> 00.<0B> 00. BA.<00> 22.<00> 22. (cont'd) E8.<22> 00.<22> -xxxx:CBE8 00. 72.<00> 40.<00> B1.<72> FF.<3E> - xxxx:CCA1 39.<3B> - -xxxx:CCA8 3F.<41> - Writing 19600 bytes - B> You are now back in DOS. You should compile and run the following program to verify that you applied the update correctly. Be sure to compile and run the program using the diskette labeled "BASIC COMPILER LIBRARY - UPDATED WORKING COPY" to verify that the updates to both files work properly. 10 OPEN "TSTPROG" FOR OUTPUT AS #1 20 FOR I=1 TO 10 30 WRITE #1,I,"A","BB","CCC","DDDD" 40 NEXT I 50 CLOSE 60 OPEN "TSTPROG" FOR INPUT AS #1 70 IF EOF(1) THEN END 80 INPUT #1,J,A$,B$,C$,D$ 90 PRINT J;A$;B$;C$;D$ 100 GOTO 70 This program should print : 1 ABBCCCDDDD 2 ABBCCCDDDD 3 ABBCCCDDDD 4 ABBCCCDDDD 5 ABBCCCDDDD 6 ABBCCCDDDD 7 ABBCCCDDDD 8 ABBCCCDDDD 9 ABBCCCDDDD 10 ABBCCCDDDD Continue to #3 AH0017 Basic Compiler Patches - #3 of 7 ************************************************************ ****** * * * * * * * 3 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== When using arrays and making calculations such as : T(J,L)=G(J)*E(L)+T(J+1,I) the compiler may give an Internal Error or the calculation may be performed incorrectly. Use the following procedure to update BASCOM.COM on your "BASIC COMPILER BASIC - UPDATED WORKING COPY" diskette. ===================== PROBLEM SOLUTION ===================== The following is a "script" of the procedure to patch your diskette. Follow it carefully. If you should make a mistake don't panic. Just start again. All user inputs are in <>'s. Do NOT type the <>'s. Make sure your DOS 1.1 diskette is in drive A and your diskette labeled "BASIC COMPILER BASIC - UPDATED WORKING COPY" is in drive B. Just a reminder: The DEBUG prompt is "-". All the things that you type are after the "-" prompt or after the "." prompt. Immediately after entering the hex digits following the "." prompts, you must press the space bar to move to the next byte. When you are entering data after the "-" prompts or entering the last set of hex digits on a line, you must press the ENTER key. Note that the "xxxx" in the data displayed line will be filled with the appropriate memory address. A> - - - xxxx:8AB3 0C If you do not see the above line of data after the "D3AB3 L1" command then you did something wrong and you should start again. You can start again by typing Q followed by ENTER. This returns you to DOS. - 04B5:8AB3 0C.<1F> - Writing A280 bytes - You are now back in DOS. Run the program below to be sure that you have updated your diskette correctly. 10 DEFINT D,F,N 20 DSD=0 30 FOR N=0 TO 7 40 FSEC=FSEC+1 50 NEXT 60 PRINT "The result is ";512*(1-DSD)*FSEC,"The result should be 4096" CONTINUE TO #4 AH0018 Basic Compiler Patches - #4 of 7 ************************************************************ ****** * * * * * * * 4 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== Mod does not return the correct value under the following conditions: (1) Using a binary noncommutative operator such as MOD, IMP, or \ (integer division with the backslash) (2) The left operand is simpler than the right operand (3) The result is required in the BX register The following example shows the problem: 10 A=3: B=4: C=10 20 PRINT "C MOD (A + B) = "; C MOD (A + B) RUN C MOD (A + B) = 7 In this example the result of the operation will always be (A + B) regardless of what the true result should be. So in general the problem is: A MOD (B + C) = (B + C) ====================== PROBLEM SOLUTION ==================== Use the procedure described below to update your IBM diskette labeled "BASIC COMPILER BASIC - UPDATED WORKING COPY". UPDATING BASCOM.COM The following procedure will update the file BASCOM.COM. Remember that the DOS 1.1 diskette should be in drive A and the diskette labeled "BASIC COMPILER BASIC - UPDATED WORKING COPY" should be in drive B. If at any time you do not see the data exactly as it appears on this procedure, you did something wrong and you should start again. You can start again by typing Q followed by ENTER. This returns you to DOS. B> - xxxx:7450 F6.<86> 87.<47> 02.<02> 00.<24> 08.<08> - Writing A280 bytes - CONTINUE TO #5 AH0019 Basic Compiler Patches - #5 of 7 ************************************************************ ****** * * * * * * * 5 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== When using several LEFT$, RIGHT$, or MID$'s in string calculations, a "string formula too complex" error is received. The error occurs when using a null string. Use the procedure described below to update your IBM Personal Computer BASIC Compiler version 1.0. ===================== PROBLEM SOLUTION ===================== The following is a "script" of the procedure to update your diskette labeled "BASIC COMPILER LIBRARY - UPDATED WORKING COPY". This procedure will be used to update BASCOM.LIB and BASRUN.EXE. Follow it carefully. If you make a mistake don't panic, just start again. Remove your BASIC diskette from drive B and insert your LIBRARY diskette. Be sure that your DOS 1.1 diskette is still in drive A. Just a reminder: If at any time you do not see the data exactly as it appears on this procedure, you did something wrong and you should start again. You can type Q followed by ENTER to return to DOS and start again. The DEBUG Search Command (-S) appears to ensure the procedure will will be inserted in the correct place. Use the spacebar to move from one field to the next when you make no entry into that field. The following procedure will update the file BASCOM.LIB. B> - 1000:**** <-----use this address (****) next - 1000:**** C0. - 1000:$$$$ <-----use this address ($$$$) next - 1000:$$$$ BB.<53> 00. 00. C3.<00> 1000:xxxx 21. - 1000:@@@@ <-----use this address (@@@@) next - 1000:@@@@ C1. 16. 01. 01. CF. - 1000:#### <-----use this address (####) next 1000:xxxx 1000:xxxx 1000:xxxx 1000:xxxx 1000:xxxx 1000:xxxx - <-----from above 1000:#### 8A. 02.<0C> 00.<00> 00.<01> 74. 1000:xxxx 20.<01> 4D.<5B> 4A. 5A.<00> 20.<00> (cont'd) 4D. 4A.<00> 5A.<00> 1000:xxxx 20. 4D. 4A.<9C> 5A.<0B> 20.<00> (cont'd) 4D.<84> 4A.<02> 5A.<06> 1000:xxxx 20.<01> 4D.<04> 4A. 5A.<05> 20.<16> (cont'd) 4D.<01> 4A.<01> 5A. 1000:xxxx 20.<8A> 4D.<02> 4A.<00> 5A.<00> 20.<74> - UPDATING BASRUN.EXE The following procedure will update the file BASRUN.EXE. B> - AX=0000 BX=0000 CX=79AA DX=0000 SP=0000 BP=0000 SI=0000 (cont'd) DI=0000 DS=04B5 EX=04B5 SS=04C5 CS=XXXX IP=0000 NV UP DI PL NZ NA C (cont'd) PO NC 047B:0000 1E PUSH DS - In the listing above, notice that the value of CS=XXXX. Whatever value is in CS will be used in the next step. For example, if the value of CS=05A1, then the first command that is used with DEBUG is B> B> - xxxx:4A1A BB. C6.<80> - XXXX:4A9D XX. XX.<7A> XX. XXXX:4AA0 XX. XX. XX.<00> XX. - Writing 7C00 bytes - CONTINUE TO #6 AH0020 Basic Compiler Patches - #6 of 7 ************************************************************ ****** * * * * * * * 6 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== It is possible for COMM buffers to be destroyed when chaining. If your program opens data files and COMM files and then chains to another program, the COMM file will be closed. Use the procedure described below to update your IBM PC Basic Compiler. Also note that the integrity of COMM buffers can be guaranteed only if they are opened before any other files in the program. ====================== PROBLEM SOLUTION ==================== The following procedure will be used to update your "Basic Compiler Library - Updated Working Copy" diskette. If you make a mistake, just start again. The DOS diskette should be in drive A: and the "Basic Compiler Library - Updated Working Copy" diskette in drive B: B> - xxxx:1BE6 52.<2C> 1C.<3B> - xxxx:2120 8E. 1E.<00> 10.<36> 05.<90> - xxxx:5714 8B.<50> F3.<98> 58. 5B. xxxx:5718 5A.<93> 59.<2E> E8.<8C> 5D.<9F> E5. CB.<48> (cont'd) 51.<93> 52.<58> xxxx:5720 53. 50.<17> E8. 10.<2E> 00.<8E> 91.<9D>8 (cont'd) F3. A4.<48> xxxx:5728 91. - Writing 7C00 bytes - CONTINUE TO #7 AH0021 Basic Compiler Patches - #7 of 7 ************************************************************ ****** * * * * * * * 7 * * * * * * * ******* ************************************************************ See Basic Compiler Patches #1 of 7 for setup procedure. ==================== PROBLEM DESCRIPTION =================== BLOAD may fail with an "Input Past End" error if the screen being loaded contains a 1A at a sector boundary. ====================== PROBLEM SOLUTION ==================== Use the following procedure to update your IBM Basic Compiler version 1.0. Insert your diskette labeled "Basic Compiler Library - Updated Working Copy" in drive B:, and your DOS diskette in drive A: B> - xxxx:4A69 04. - Writing 7C00 bytes - B> With your "Basic Compiler Library - Updated Working Copy" diskette still in drive B: use the following directions for using DEBUG to install the patch. Again, if you make a mistake, type Q and start over again. B> A> - - xxxx:015E 04. - - A> ************************************************************ ************** IF ALL SEVEN PATCHES HAVE BEEN ************** ************** INSTALLED, THEN YOU HAVE ************** ************** FINISHED INSTALLING THE ************** ************** BASIC COMPILER PATCHES ************** ************************************************************