KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q66560: "Illegal Function Call" Using Coprocessor in BASIC 7.10

Article: Q66560
Product(s): See article
Version(s): 7.00 7.10 | 7.00 7.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | SR# S901018-77 buglist7.00 buglist7.10 | mspl13_basic
Last Modified: 12-NOV-1990

The following program gives an "Illegal Function Call" error when run
as a .EXE program using a math coprocessor; however, it works
correctly in the QBX.EXE environment or with the coprocessor disabled.

Microsoft has confirmed this to be a problem in Microsoft BASIC
Professional Development System (PDS) versions 7.00 and 7.10 for
MS-DOS and MS OS/2. We are researching this problem and will post new
information here as it becomes available.

Workaround
----------

To work around this problem, do one of the following:

1. Break the complex equation into smaller parts that are evaluated
   separately.

-or-

2. Turn off use of the coprocessor with SET NO87="message" at the DOS
   prompt.

-or-

3. Compile using the alternate math (/FPa) option.

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

a = .475
b = 75
c = 62
d = .007
e = 22
f = (b * e ^ 2 / d) * SQR(1 / ((2 * b * c * a) ^ 2 + (b ^ 2 - c ^ 2))

Simplifying the equation eliminates the problem. For example, removing
the (b * e ^ 2 / d) factor eliminates the error.

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.