Microsoft KB Archive/66560

= &quot;Illegal Function Call&quot; Using Coprocessor in Basic 7.10 =

Article ID: 66560

Article Last Modified on 11/21/2006



This article was previously published under Q66560



SYMPTOMS
The following two program examples give an &quot;Illegal Function Call&quot; error when run as a .EXE program using a math coprocessor; however, the programs work correctly in the QBX.EXE environment or with the coprocessor disabled.



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


 * 1) Break the complex equation into smaller parts that are evaluated separately. -or-


 * 1) Turn off use of the coprocessor with SET NO87=&quot;message&quot; at the MS-DOS prompt. -or-


 * 1) Compile using the alternate math (/FPa) option.



STATUS
Microsoft has confirmed this to be a bug 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.



Code Example 1
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.

Code Example 2
f% = 20 q = 7 w5% = 1 ax = 1 scal = 20 * (4.666 * w5% / ax) x1% = 95 fb = 50.967 fsd = 33 a = fb ^ 2 / fsd ^ 2 qtsd = .26 b = (a / qtsd) + (fb / (q * fsd)) vasd = 3 nd% = 1 vb = .738 c = 1 + a + (fb / (q * fsd * qtsd)) + (vasd * nd% / vb) d = (1 / qtsd) + (fb / (q * fsd)) frq = f% / fsd y1=frq^4 / (((frq^4 - c*frq^2 + a)^2 + (b * frq - d * frq^3)^2)^.5) The last line in this example also gives an &quot;illegal function call&quot; under the same circumstances as Example 1 in this article.

Additional query words: BasicCom SR# S901018-77 buglist7.00 buglist7.10

Keywords: KB66560

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.