can anyone tell me how to link masm output with other object files. for example main.obj. I am developing a windows kernel mode driver and I want to move inline asm blocks to seperate .asm files for further requirements and prevent further difficulties for example: x64 does not support inline asm. So, i added vm.asm source file to project and from build customization i have selected masm. after that i have selected Microsoft Macro Assembler for Item Type. When i build project vm.obj file has created successfully for vm.asm file. But i cant call asm functions (proc) from C code. It should be link error i think build process not putting obj files together. also i tried with stdcall and cdecl but result is same. my vm.asm:
here is my c call:
error: project_ddk\main.obj : error LNK2019: unresolved external symbol _get_vm referenced in function _DispatchPnP@8 my ml.exe commandline: ml.exe /c /nologo /safeseh /Zi /Fo"%(FileName).obj" /Fl"" /W3 /errorReport:prompt /Ta |
|||||||||||||||||||||
|
Here is some sample that I used to test to link against C (hope it helps). main.cpp:
test.asm
Custom build step in VS2008:
|
|||||||||
|
I have never made C functions with masm but in normal procedures you need a text segment, It might need a text segment defined.
EDIT: I just tried to make a simple procedure that works in C, i got this and this works; MASM proc;
C call;
cmd; masm -> C -> output -> |
联系客服