Setting Up Visual Studio 10 for MASM32 Programming

Posted on Updated on

If you are like me and want the comfort and support that Microsoft’s Visual Studio 10 provides, then you will defiantly want that support in your MASM programming tasks. Visual studio makes this quite easy, with a couple of project property changes you will be on your way to MASM programming bliss.


  1. Create new Visual C++ Empty Project
  2. Right click on the newly created project and select Build Customizations; select masm option, press ok then save the project.
  3. Go to project properties and select linker->system then change subsystem to Windows (/SUBSYSTEM:CONSOLE)
  4. Download and install masm32 libraries then add them to your linker settings.
  5. Go to linker->Advanced and change Entry Point to main [this is what the linker will look for when mapping the entry point for your app.]
  6. Go to Linker->Input  and add masm32.lib to Additional Dependencies.
  7. Go to Microsoft Macro Assembler->General and add the masm32 libraries.
  8. Download and paste usertype.dat into C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
  9. Go to Visual Studio Options->Text Editor->File Extensions: Type asm in the extension box then select Microsoft Visual  C++ from the list.
  10. Right click on project and select Add->New Item: Select Text File and save with *.asm
  11. Create, run and enjoy your code 🙂

In a future post I will show how to turn this project into a Visual Studio project template.


22 thoughts on “Setting Up Visual Studio 10 for MASM32 Programming

    chudd said:
    November 13, 2011 at 9:25 pm

    Is the future post coming soon?

      Romaine Carter said:
      November 14, 2011 at 2:27 am

      Yes it is, I have been very busy with my day job recently; however, It will be available in another week or so.

    Wayne E. Pfeffer said:
    November 17, 2011 at 3:08 pm

    I was able to follow your instructions up to step 7. What reason would there be for ‘Microsoft Macro Assembler’ not to show up in the menu listing?

      Romaine Carter said:
      November 17, 2011 at 8:30 pm

      You may have not completed step 2 correctly. Once you selected masm(.targets, .pops) in build customizations the ‘Microsoft Macro Assembler’ listing should be visible in the configuration settings.

      Pen Tester said:
      November 25, 2011 at 9:42 pm

      I had the same problem. I saved the entire project and source files. Closed and re-opened VS and it was only then I could see it. You have probably seen it already, but just thought I’d say it for other users that may be wondering the same thing.

      Hope it helps.

        Romaine Carter said:
        November 26, 2011 at 8:07 pm

        Thanks for that observation.

        Herb Martin said:
        January 8, 2012 at 3:05 am

        First, EXCELLENT ARTICLE!!!!

        I too had the issue of MASM item not showing up in the options tree view, even though I correctly followed, and rechecked the instructions multiple times.

        I suspected that “saving the project” might be a useful step but unlike Pen Tester didn’t try but rather rather just tried compiling.

        After the first compile (attempt) the options displayed the Masm elements.

        Likely this is a small, but beginner frustrating, bug in Visual Studio. Without Romaine excellent instructions I might not have had the stubborness to keep trying until it showed up.

        I do suggest mentioning it in one of the steps when you get a chance. (#2 or later in #7 when it is needed).

        Also, I had the include directories already HARDCODED in my source file so it may not have mattered (much) for me up to this point.

        But the really cool thing is that now I can debug my Masm using VS10.

        Thanks so much Romaine.

        Now, I need to figure out how to deal with debugging a multi-threaded app. My worker threads don’t seem to be running within the debug session even though they run fine outside the debugger — off to Google again….


        Romaine Carter said:
        January 9, 2012 at 6:45 pm

        Thanks HerbM I will update the post to reflect your suggestion.

    Tuntuni said:
    February 21, 2012 at 6:31 pm

    Same problem here. Macro Assembler isn’t showing up. I had to first add an assembly file, set its own Macro Assembler property first and then go back to the main project and set the Macro Assembler property for the whole project. :/ Anyways, thanks for the tutorial!! I loved it. 🙂

      Romaine Carter said:
      February 21, 2012 at 11:29 pm

      Saving the project at step #2 may help.

    Tuntuni said:
    February 21, 2012 at 6:36 pm

    Still haven’t managed to get the syntax highlighting. =/ It won’t even compile. Hmm …

      Romaine Carter said:
      March 20, 2012 at 8:44 am

      Hi Tuntuni, just restart the tutorial with a new project. That should help.

    Noteworthy said:
    April 7, 2012 at 4:43 am

    The usertype.dat isn’t available in the link, it look like that Ivrin’s website is currently down. Could someone upload it again please !

      Romaine Carter said:
      April 8, 2012 at 6:37 am

      I will be uploading usertype.dat to the blog and changing the link address. Thanks for the heads up.

    Noteworthy said:
    April 7, 2012 at 4:48 am

    I have another question. I’m using Masm32/JWasm. I figured out after a long time of coding that VS is a solid IDE. I’m sticking to it actually. Could you explain to us how can we set that assembler for the free version of VS (express one’s) and how to set up syntaxe hilghiting.

      Romaine Carter said:
      April 8, 2012 at 6:38 am

      Thanks for the suggestion I will be working on that as soon as possible, possibly in my next blog post 🙂

    MrFrety said:
    February 17, 2013 at 2:12 pm

    Step 8: Link incorrect (404)

    waleed said:
    October 5, 2013 at 12:03 am

    i cannot view microsoft macro assembler option in Configuration manager.I have also installed the masm libraries.

    Xuan said:
    October 6, 2013 at 5:07 am

    I’m using VS 2012 express & followed all the above steps but I’m getting the following errors whenever I’m trying to build my project:

    Error 1 error A1000: cannot open file : C:\Users\XYZ\documents\visual studio 2012\Projects\masm_demo\masm_demo\source.asm 8 1 masm_demo

    Error 2 error MSB3721: The command “ml.exe /c /nologo /Zi /Fo”Debug\source.obj” /I “C:\masm32\lib” /I “C:\masm32\macros” /I “C:\masm32\include” /W3 /errorReport:prompt /Tasource.asm” exited with code 1. C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\V110\BuildCustomizations\masm.targets 49 5 masm_demo

    kash said:
    September 26, 2016 at 5:59 am

    can i create more than one .asm file in the project and build/debug/run them independently??

      Romaine Carter responded:
      September 26, 2016 at 10:20 am

      Hi kash,

      It can’t be done with that configuration since the entry point is already set to “main”. A workaround would be to create multiple entry point functions then switch the linker entry point when you need to run the other .asm files.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s