Expanded Memory Emulators Slow Floating-Point Operations (61676)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0
  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft C for MS-DOS 5.1
  • Microsoft FORTRAN Compiler for MS-DOS 4.0
  • Microsoft FORTRAN Compiler for MS-DOS 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.

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB61676