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:
.386
.model flat, C
option casemap :none
PUBLIC _get_vm
_get_vm PROC
mov eax, 0101h
db 0fh
db 01h
db 0c1h
ret
_get_vm endp
END
here is my c call:
ULONG vm_id;
extern int _cdecl get_vm();
vm_id = get_vm();
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