Malfist
Malfist

Reputation: 31795

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.

Upvotes: 18

Views: 16351

Answers (2)

Hans Passant
Hans Passant

Reputation: 941455

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

Upvotes: 21

sblom
sblom

Reputation: 27343

I don't think you can do this in "modern" Visual Studio builds. Here are instructions for a very old one: http://jimweller.com/jim-weller/jim/vc98asmqs/vc98asmqs-4.html

Edit: Looks like you're right--it shipped with VS 2005. Since then, Microsoft has started to distribute MASM for free, and have probably discontinued support for it. :(

Upvotes: 0

Related Questions