Returning a Float from Assembly to C (117682)
The information in this article applies to:
- Microsoft Macro Assembler (MASM) 6.0
- Microsoft Macro Assembler (MASM) 6.0a
- Microsoft Macro Assembler (MASM) 6.1
- Microsoft Macro Assembler (MASM) 6.1a
- Microsoft Macro Assembler (MASM) 6.11
This article was previously published under Q117682 SUMMARY
Returning floating-point values from an assembly module to a C module
presents certain problems: Small- or medium-model C code expects AX to
contain the address of a memory location that contains the return value,
while compact- or large-model C code expects DX:AX to contain the address
of this memory location. This is explained very briefly in the chapter on
mixed-language programming in the "MASM Programming Guide," but no examples
are provided there. In the "MORE INFORMATION" section, below, is sample
code that illustrates how to pass and return a floating-point value from
assembly code to C code.
REFERENCES
For additional information on returning floating-point values from a DLL,
please see the following article in the Microsoft Knowledge Base:
86081 PRB: DLL Function Returns Float or Double Value Incorrectly
Modification Type: | Minor | Last Reviewed: | 10/14/2003 |
---|
Keywords: | KB117682 |
---|
|