Linking an assembly routine into a GCC project
(Sorry if this is a common topic or is in the wrong board ive tried searching to no solution)
I have the below assembly routine (computes e^X - 58 cpu clock cycles on an athalon - I would be impressed if someone could find a faster routine :D) written in MASM syntax, and I no matter what I try I cannot manage to be able to use it from my C++ source.
I have declared:
-e_pwX PROTO : DWORD (In Assembly Source)
-extern void e_pwX(FLOAT *); (In C++ Source)
And assembled the assembly source into a (COFF) object binary and included this file in the linker command line but when trying to compile I get this error:
[Linker error] undefined reference to `e_pwX(float *)'
My somewhat limited understanding of C++ doesn't help either but I will be grateful for any suggestions.
e_pwX PROC C lpFloat: DWORD
fmul ; z = x*log2(e)
fist DWORD PTR [esp+12] ; round(z)
fstp TBYTE PTR [esp]
fisub DWORD PTR [esp+12] ; z - round(z)
mov eax, [esp+12]
fadd ; 2^(z-round(z))
fld TBYTE PTR [esp] ; 2^(round(z))
fmul ; 2^z = e^x