Microsoft KB Archive/61676

= Expanded Memory Emulators Slow Floating-Point Operations =

Article ID: 61676

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1
 * Microsoft C Professional Development System 5.1
 * Microsoft FORTRAN Compiler 4.0
 * Microsoft FORTRAN Compiler 4.1

-



This article was previously published under Q61676



SUMMARY
Floating-point mathematics in Microsoft languages may be slower when running with expanded memory emulators. This is a result of the expanded memory emulators redirecting interrupts used by the floating-point routines.

This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5 for MS-DOS; Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS; Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS; Microsoft QuickC versions 2.0 and 2.01 for MS-DOS; Microsoft C versions 5.0 and 5.1 for MS-DOS; Microsoft C Professional Development System version 6.0 for MS-DOS; Microsoft Pascal version 4.0; and Microsoft FORTRAN versions 4.0 and 4.1 for MS-DOS.

Microsoft is researching this problem and will post new information here as it becomes available.

If your programs are not using a coprocessor, you can work around this problem by using the alternate math library (BC /Fpa) option found in Microsoft Basic PDS 7.0 and 7.1 or in Basic Compiler 6.0 and 6.0b.



MORE INFORMATION
One customer found that the EMM386.SYS driver (run with MS-DOS 5.0) slowed down his QuickBasic executable programs that used intensive floating-point calculations, doubling or tripling execution times. The customer also noted that EMM386 did not affect the speed of executables that used only integer computations (or used the CURRENCY data type found in Basic PDS).

Expanded memory managers on 80386/80486 systems generally run in a virtual 8086 mode that allows them to trap and handle memory access requests (this allows them to trap and handle all calls relating to expanded memory). When running in virtual 8086 mode, interrupts are trapped by the virtual machine manager.

In the case of the interrupts used for floating-point emulation, the virtual machine manager does not handle them, so it reflects the interrupts back to real mode where they are handled by the floating-point emulator.

Instead of directly calling the floating-point routines, the processor must switch between protected and real modes as well as performing checks to see if it should handle the interrupt. This extra processing by the virtual machine manager is responsible for the reduced performance.

Additional query words: QuickBas BasicCom 4.00 4.00b 4.50 5.00 5.10 6.00 6.00b 7.00 7.10

Keywords: KB61676

-

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

© Microsoft Corporation. All rights reserved.