Microsoft KB Archive/44283

BC 6.00b Problems CHAINing Between Small & Large EXE Programs PSS ID Number: Q44283 Article last modified on 05-02-1991 PSS database name: B_BasicCom

6.00 6.00b

MS-DOS

Summary:

CHAINing between a very small EXE program (with a load size much smaller than 64K) and a large EXE program (with a load size greater than 64K) can produce unsatisfactory results at run time. Symptoms of this problem include corrupted data, corrupted stack, or “illegal syntax” errors when reading DATA statements. (The run-time load size for an EXE program can be determined by examining it with the EXEMOD.EXE utility, provided on the Microsoft BASIC Compiler version 6.00 or 6.00b disk.)

Microsoft has confirmed this to be a problem in EXE programs compiled with the Microsoft BASIC Compiler versions 6.00 and 6.00b when running under MS-DOS. (The problem does not occur when CHAINing in the protected mode of OS/2.)

By calling Microsoft Product Support Services, those of you using the Microsoft BASIC Compiler version 6.00b can obtain the following disk, which corrects the problem: “BC 6.00b CHAIN Correction.” Please specify 5.25-inch or 3.5-inch disk format.

This file can also be found in the Software/Data Library by searching on the word CHAINFIX, the Q number of this article, or S12271. CHAINFIX was archived using the PKware file-compression utility.

After you download CHAINFIX and take it out of archive format, you will get the following files:

BRTM61R (a binary file that you should rename BRTM61R.LIB) BRTMDOC (a text file repeating the instructions further below)

Those using the Microsoft BASIC Compiler version 6.00 must order an upgrade to version 6.00b by calling Microsoft Customer Service at (206) 882-8088 before you can use the “BC 6.00b CHAIN Correction” disk or the CHAINFIX file. Version 6.00b may no longer be in stock; therefore, the ultimate solution for 6.00 owners is to upgrade to BASIC Professional Development System (PDS) version 7.10, which does not have the problem.

More Information:

The “BC 6.00b CHAIN Correction” disk includes the replacement of the Library 3 disk for 5.25-inch format and the Library 2 disk for 3.5-inch format. The only changed file on the disk is BRTM61R.LIB, which has the following size (in bytes) and time stamp:

BRTM61R.LIB 124577 9-19-1988 7:53P

Once you obtain this revised file, you should rebuild the run-time libraries BRUN61ER.EXE and BRUN61AR.EXE with BUILDRTM, as shown below.

Note: This CHAIN problem does not occur in the QB.EXE (QuickBASIC) editor environment, which is shipped with the Microsoft BASIC Compiler 6.00 and 6.00b.

Installing the Replacement BRTM61R.LIB
If the Microsoft BASIC Compiler version 6.00b is already installed on your hard disk, do the following:

  Replace the copy of BRTM61R.LIB on your hard disk.   Use the BUILDRTM.EXE Utility to create the updated run-time libraries as follows:   Create BRUN61ER.LIB and BRUN61ER.EXE in MS-DOS as follows: BUILDRTM /Default   Create BRUN61AR.LIB and BRUN61AR.EXE in MS-DOS as follows: BUILDRTM /Default /FPa    Store the replacement disk with the original masters. In the future, the replacement should be used in place of the original disk (Disk 3 for the 5.25-inch set, and Disk 2 for the 3.5-inch set). 

If version 6.00b is not installed on your hard disk, do the following:


 * 1) The disk provided should replace Disk 3 for the 5.25-inch set and Disk 2 for the 3.5-inch set (or, on a backup copy, replace the BRTM61R.LIB file.)
 * 2) With the disk replaced, run the SETUP utility found on Disk 1. When the libraries are created, the new library will be used. Once the new run-time library is created, be sure to recompile and link existing source files. This ensures all programs are using the correct libraries and run-time routines.

Interim Workarounds Without Replacing BRTM61R.LIB
There are four workarounds to this problem:


 * 1) Increase the size of the smaller program or decrease the size of the larger program.
 * 2) Use the RUN statement instead of the CHAIN statement.
 * 3) If your program READs input from (a large number of) DATA statements, input data from a disk file instead of using READ and DATA.
 * 4) Replace $INCLUDE statements by putting the actual code into the source file.

Additional reference words:

appnote BB0093

Copyright Microsoft Corporation 1991.