Search code examples
visual-studioassemblyvisual-studio-2015masm

error A1000 with MASM visual studio 2015


I'm reading a book "Guide to Assembly Language" by James T.Streib in order to learn Assembly but I can't compile the test example on visual studio 2015 because of the following error:

1>   Assembling: 
1>MASM : fatal error A1000: cannot open file
1>  Microsoft (R) Macro Assembler Version 12.00.31101.0

I added this in the Custom Build Tool Command Line of my main.asm file:

ml -c -Zi "-Fl$(IntDir)\$(InputName).lst" "-Fo$(IntDir)\$(InputName).obj" "$(InputPath)"

And Outputs:

$(IntDir)\$(InputName).obj

I also added msvcrt.lib in the Additional Dependencies of the linker.

Any idea ?


Solution

  • Try using the following for the Command Line field:

    ml -c -Zi "-Fl$(IntDir)%(Filename).lst" "-Fo$(IntDir)%(Filename).obj" "%(FullPath)"
    

    and this for the Output field:

    $(IntDir)%(Filename).obj
    

    The old "Input" macros are deprecated in Visual Studio 2015 and have been replaced by new "item metadata macros" that use the %() syntax.

    Here's a screenshot showing where I've entered these lines. Note that I've changed to the "Configuration" and "Platform" pulldowns to "All Configurations" and "All Platforms" respectively so that these parameters are used no matter what sort of build is being performed.

    Visual Studio 2015 .ASM Custom Build Tool Property Page