I am trying to combine these languages for testing purposes. Does anyone know why, after building the project the clear function cannot be found when the .asm file is in the source folder. The following images shown below should explain what I am asking and I will edit further.
Visual Studio with an assembly and C++ file
this last photo shows the properties from my .asm file
.586 ;Target processor. Use instructions for Pentium class machines
.MODEL FLAT, C ;Use the flat memory model. Use C calling conventions
.STACK ;Define a stack segment of 1KB (Not required for this example)
.DATA ;Create a near data segment. Local variables are declared after
;this directive (Not required for this example)
.CODE ;Indicates the start of a code segment.
clear PROC
xor eax, eax
xor ebx, ebx
ret
clear ENDP
END
If you skipped the default, you need to create a custom build step. Right click on the assembly source file name, then properties / custom build step and enter command line and outputs fields:
for debug build:
for release build:
Also you may need to declare clear as public in the assembly source file:
For a 64 bit build, use ml64 instead of ml.
I generally start a new project by creating an "empty project", then adding existing items (source file) to avoid the default stuff created by VS.