KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Article: Q63040
Product(s): See article
Version(s): 7.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S900615-62 buglist7.00 fixlist7.10 | mspl13_basic
Last Modified: 6-AUG-1990

LINK-overlaid programs using the BRT70xxx.EXE run-time module from
Microsoft BASIC Professional Development System (PDS) version 7.00
should not be LINKed with the /F (/FARCALLTRANSLATION) option. When
this is done, a CALL to an overlay causes an attempt to reload the
run-time module. This results in an "Invalid runtime module" message
and, in most cases, the machine hangs.

To work around this problem, LINK without the /F option or compile
for a stand-alone .EXE (with the BC /O option).

Microsoft has confirmed this to be a problem in Microsoft BASIC PDS
version 7.00. This problem does not occur in BASIC PDS 7.10.

The /F (/FARCALLTRANSLATION) LINK option is described on Page 241 of
the "Microsoft CodeView 2.3 and Utilities User's Guide" for Microsoft
BASIC PDS version 7.00 for MS-DOS. Using this option may produce a
slight gain in speed and size of executables by translating far calls
to near calls. However, attempts to optimize overlaid calls cause a
problem with the run-time module. Thus, /F should not be used with an
overlaid program that is using the run-time module.

Code Example
------------

The following programs (which are separate .BAS source files)
compose a simple overlaid program that demonstrates the problem:

CALLOVL.BAS
-----------

INPUT "Call overlay (Y/N)? ",i$
IF ((i$ = "Y") OR (i$ = "y")) THEN CALL test
END

OVL.BAS    **** NOTE: This is a file separate from the above file!
-------

SUB test
  PRINT "in overlay"
END SUB

The following are the compile and LINK lines to demonstrate the
problem with the above separate modules:

   BC CALLOVL;
   BC OVL;
   LINK /F CALLOVL+(OVL);

These programs can be run properly if either /O is added to each BC
command line or the /F is omitted from the LINK line.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.