Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a pure assembly project in Visual Studio?

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.

like image 659
Malfist Avatar asked Apr 27 '10 01:04

Malfist


People also ask

Does Visual Studio have 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.

How do I get assembly code in Visual Studio?

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 )


1 Answers

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
like image 140
Hans Passant Avatar answered Oct 28 '22 03:10

Hans Passant