Microsoft KB Archive/44157

4.00/4.00b Problems CHAINing Between Small and Large EXEs PSS ID Number: Q44157 Article last modified on 05-02-1991 PSS database name: B_QuickBas

4.00 4.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 bad results at run time. Different programs can give different symptoms, and the results may not be predictable. Possible symptoms include corrupted data, corrupted stack, or “illegal syntax” errors when reading DATA statements.

Microsoft has confirmed this to be a problem in EXE programs compiled with Microsoft QuickBASIC versions 4.00 and 4.00b and the Microsoft BASIC Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b) when running under MS-DOS.

This problem was corrected in Microsoft QuickBASIC version 4.50, and in Microsoft BASIC Professional Development System (PDS) version 7.00 (fixlist7.00).

More Information:

This CHAIN problem does not occur in the QB.EXE editor environment.

A separate article describes how owners of Microsoft BASIC Compiler version 6.00b can obtain a file that corrects this CHAIN problem. Query for this article as follows:

CHAIN and SOFTLIB and 6.00b

Owners of the Microsoft BASIC Compiler version 6.00 must first order an upgrade to version 6.00b by calling Microsoft Customer Service at (206) 882-8088 before they can use this BC 6.00b CHAIN correction. However, 6.00b upgrades may be no longer available, and the better solution is to upgrade to Microsoft BASIC Professional Development System (PDS) version 7.10.

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, or with the Microsoft Macro Assembler versions 4.x or 5.x.

Aside from upgrading to version 4.50, you can try one of the following to work around this problem CHAINing .EXE programs compiled with QuickBASIC version 4.00 or 4.00b:


 * 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.

Copyright Microsoft Corporation 1991.