KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q60429: Using the C Emulator Library with an Assembly Program

Article: Q60429
Product(s): See article
Version(s): 5.10 5.10a | 5.10 5.10a
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | | mspl13_masm
Last Modified: 12-JUN-1990

An Assembler module may use a C emulator library if the assembler
module is called by a main C module. The C emulator library must be
used during the linking of the assembler and C modules.

Linking with the emulator library ensures that the assembler will have
floating-point math support with or without a a math coprocessor.

The math functions in the C run-time library require floating-point
support to perform calculations with real numbers. This support can be
provided by the floating-point emulator libraries that accompany your
compiler software or by an 8087 or 80287 coprocessor.

The assembler module -- if run as a stand-alone module, without a math
coprocessor, and linked to an emulator library -- generates emulator
interrupts for floating-point math code, but will not run because the
interrupts will not be initialized. The C start-up code is necessary
to initialize the interrupts. If you want to run the assembler module
as stand-alone, you must write your own emulator library.

With C, /FPi is the default switch. This switch selects the emulator
math package and generates inline floating-point instructions.

   CL /c calling.c

The assembler module is assembled with the following command, where
(by default) code is generated for a math coprocessor (if
floating-point instructions are used)

   MASM /E called.asm

where CALLING.C and CALLED.ASM are the calling and called modules,
respectively.

While programming in the QuickC environment, /FPi must be specified in
the Global Custom Flags field of the Assembler Flags Dialog box
(reached through the Options menu). This allows the C emulator library
to be used for all the assembler modules.

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.