I am trying link an .asm file into my kernel mode driver

  • Thread starter Thread starter jguo5258
  • Start date Start date
J

jguo5258

Guest
I am developing a kernel mode windows driver and I need to use float functions from an .asm file, but I get errors. The .cpp file also seems to not be able to find the extern asm functions.

What I did:
I set build customizations to masm(.targets, .props)
I created a new file with .asm extension and with these command line options:
ml64.exe

I included the .asm file in my .cpp file
I did this for extern function and the cpp cannot find the asm function:


extern "C" {
float __sqrtf(float);
float __sinf(float);
float __cosf(float);
float __tanf(float);
float __atan2f(float, float);
};



The errors:

Severity Code Description Project File Line Suppression State
Error MSB3721 The command "ml64.exe /c /nologo /Zi /Fo"x64\Release\math.obj" /W3 /errorReport:prompt C:\Program Files (x86)\Microsoft Visual
Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\Hostx64\x64\ml64.exe /Tamath.asm" exited with code 1. KMDF Driver1 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\
v160\BuildCustomizations\masm.targets 70




Severity Code Description Project File Line Suppression State
Error A1000 cannot open file : C:\Program KMDF Driver1 C:\Users\jguo5\OneDrive\Documents\GitHub\myproject\MmCopyVirtual Communication\KMDF Driver1\MASM 1


expected a declaration


my asm file:


.code

fwrap macro a, b
sub rsp, 10h
cvtss2sd xmm0, xmm0
movsd qword ptr [rsp], xmm0
fld qword ptr [rsp]
a
b
fst qword ptr [rsp]
movsd xmm0, qword ptr [rsp]
cvtsd2ss xmm0, xmm0
add rsp, 10h
ret
endm

__sqrtf proc
fwrap fsqrt
__sqrtf endp

__sinf proc
fwrap fsin
__sinf endp

__cosf proc
fwrap fcos
__cosf endp

__tanf proc
fwrap fptan, fmulp
__tanf endp

arg1 macro
cvtss2sd xmm1, xmm1
movsd qword ptr [rsp], xmm1
fld qword ptr [rsp]
endm

__atan2f proc
fwrap arg1, fpatan
__atan2f endp

end

Continue reading...
 
Back
Top