Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Unable to export intrinsic function "_CIexp" in msvcrt.dll

sagarrsagarr Member Posts: 1
Hi All,
I'm new to this DLL and C stuff. But I have to do this project.

Here is my problem:

We had a already build project (Its OS ) and it emulate the mscvrt.dll, now I need to implement an intrinsic version of exp() using assembly language, but I'm not able to do that.

Here is the code I'm trying:
msvcrt.def
[code]LIBRARY MSVCRT

EXPORTS
??2@YAPAXI@Z
??3@YAXPAX@Z
.
.
_CIfmod
_CIexp // I want to implement this function in msvcrt.dll
.
.[/code]
exp.asm code:
[code];-----------------------------------------------------------------------------
; exp.asm - floating point exponent
;-----------------------------------------------------------------------------
.386
_TEXT segment use32 para public 'CODE'
public _exp
public __CIexp

_exp proc near
assume cs:_TEXT
push ebp
mov ebp,esp
sub esp,8 ; Allocate temporary space
fld qword ptr [ebp+8] ; Load real from stack
fldl2e ; Load log base 2(e)
fmulp st(1),st ; Multiply x * log base 2(e)
fst st(1) ; Push result
frndint ; Round to integer
fsub st(1),st ; Subtract
fxch ; Exchange st, st(1)
f2xm1 ; Compute 2 to the (x - 1)
fld1 ; Load real number 1
fadd ; 2 to the x
fscale ; Scale by power of 2
fstp st(1) ; Set new stack top and pop
fst qword ptr [ebp-8] ; Throw away scale factor
mov esp,ebp ; Deallocate temporary space
pop ebp
ret
__CIexp endp

assume cs:_TEXT
push ebp
mov ebp,esp
sub esp,8 ; Allocate temporary space
fld qword ptr [ebp+8] ; Load real from stack
fldl2e ; Load log base 2(e)
fmulp st(1),st ; Multiply x * log base 2(e)
fst st(1) ; Push result
frndint ; Round to integer
fsub st(1),st ; Subtract
fxch ; Exchange st, st(1)
f2xm1 ; Compute 2 to the (x - 1)
fld1 ; Load real number 1
fadd ; 2 to the x
fscale ; Scale by power of 2
fstp st(1) ; Set new stack top and pop
fst qword ptr [ebp-8] ; Throw away scale factor
mov esp,ebp ; Deallocate temporary space
pop ebp
ret
__CIexp endp


_TEXT ends
end
[/code]

Now whenever I build this "msvcrt" project it, throws an linker error like [b]"unresolved external symbol _CIexp".[/b]
I'm frustrated because I don't have any knowledge of DLL, VC++ and assembly, but i need to do this because of rescission period :(
Pleas help me here.
Sign In or Register to comment.