Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't build Assembly Language program in Visual Studio

I am trying to build an assembly language in Visual Studio 2013 using MASM. If I import an .asm file, it initially builds. However, the second I go to make changes to that file, most of the code is highlighted red. Visual Studio is treating this assembly program as a C++ file or similar. Even though I have the MASM box selected in Build Customization, the program will not build because it does not recognize the syntax.

Can anyone help?

like image 752
jshapy8 Avatar asked Jul 12 '26 15:07

jshapy8


1 Answers

Visual Studio includes ML.EXE (32 bit) and ML64.EXE (64 bit). I generally create a custom build step for each .asm file in a project. For VS 2015, I right click on source file name, ..., choose custom build tool, and I also set "excluded from build" to "No" , for all configurations. The options for custom build tool or custom build step are:

Example debug build:

Command Line: ml /c /Zi /Fo$(OutDir)\example.obj example.asm

Outputs: $(OutDir)\example.obj

Example release build:

Command Line: ml /c /Fo$(OutDir)\example.obj example.asm

Outputs: $(OutDir)\example.obj

If building a 64 bit program, use ML64 instead of ML.

like image 150
rcgldr Avatar answered Jul 15 '26 04:07

rcgldr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!