How can I make a masm project in Visual Studio? I remember doing this in class a while back, but I've since forgotten, and Google is only getting me inline assembly.
The Visual Studio project system supports assembler-language files built by using MASM in your C++ projects. MASM fully supports x64 assembler-language source files, and builds them into object files. You can then link these object files to your C++ code built for x64 targets.
You can normally see assembly code while debugging C++ in visual studio (and eclipse too). For this in Visual Studio put a breakpoint on code in question and when debugger hits it rigth click and find "Go To Assembly" ( or press CTRL+ALT+D )
Start with the Win32 Console mode project template. Delete the .cpp files. Right-click the project in the Solution Explorer window, Custom Build Rules, check Microsoft Macro Assembler. In VS2015 use Build Dependencies, Build Customizations, check masm.
Add a new .asm file by right-clicking the Source Files node, Add, Code, C++ File, be sure to use the .asm extension. In the property window change the File Type to C/C++ Code so it gets passed to the linker.
Linker settings, Manifest file, Generate = No. With these settings I could build and debug this sample .asm file:
.486
.MODEL FLAT
.CODE
START:
ret
END START
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With