Using Visual Studio 2008 to build, connect, debug, and run MASM 6.11. Build code

I would like to use Visual Studio 2008 as much as possible, effectively compiling / linking / building / etc the code, as if all these build processes were performed using the tools provided by MASM 6.11. The exact version of MASM doesnโ€™t matter if it is within the 6.x range, as this is what my college uses to train 16-bit builds.

I did some research on this and came to the conclusion that there are several options:

  • Reconfigure VS to invoke MASM 6.11 executable files with the same flags, etc., since MASM 6.11 will do this on its own.
  • Create intermediate batch files that VS will invoke to then invoke the appropriate commands for the MASM linker, etc.
  • Reconfigure the built-in build tools / VS rules (collector, linker, etc.) to provide an environment identical to the environment used by MASM 6.11.

Option (2) was raised when I realized that the parameters available in the VS "External Tools" interface may not be sufficient for the MASM assembly tools to be called correctly, so a batch file can be useful for interpreting VS strict argument passing methods, as many my knowledge of how to get this working is related to my call to ML.exe, LINK.exe, etc. from the command line.

Below are a few links that may be helpful in answering my question. Please keep in mind that I have read them all, and none of them is a real solution. I can only hope that my MASM 6.11 pointer does not stop anyone from giving a more generalized answer.

A similar method used for Option (2), but users in the stream do not connect:
http://www.codeguru.com/forum/archive/index.php/t-284051.html
(I also have doubts about the need for an intermediate batch file)

Outdated explanation to my question:
http://www.cs.fiu.edu/~downeyt/cop3402/masmaul.html

Probably the closest that I came to the final solution, but relates to a toolbox from something other than MASM, also uses a batch file:
http://www.kipirvine.com/asm/gettingStarted/index.htm#16-bit

I apologize if my terminology for the tools used at each stage of the code โ†’ exe process is disabled, but since I try to reproduce all the steps between completing the writing of the code and creating the executable, I donโ€™t think it matters much.

+6
assembly masm compilation visual-studio-2008 visual-studio
source share
6 answers

There is a MASM rule file located in (32-bit system removes (x86) ):

 C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\VCProjectDefaults\masm.rules 

Copy this file to the project directory and add it to the custom build rules for your project. Then โ€œEdit rule file ...โ€, select the MASM build rule and โ€œChange build rule ...โ€.

Add object:

  • User Property Type: String
  • The default value is *. inc
  • Description: Add additional MASM file dependencies.
  • Display Name: Additional Dependencies
  • Read Only: False
  • Name: AdditionalDependencies
  • Property Page Name: General
  • Switch: [value]

Set the value of the [AdditionalDependencies] additional dependencies. Now the assembly automatically detects changes in *.inc , and you can edit the properties for a single asm file to specify others.

+4
source share

You can create a make file project. In Visual Studio, in the File / New / Project section, select Visual C ++ Project / Makefile.

This allows you to execute an arbitrary command to create your project. It should not be C / C ++. It doesn't even have to be a traditional makefile NMake. I used it to compile the driver using a batch file and using an NAnt script.

It's easy enough to get it to run the MASM 6.x toolchain.

+2
source share

I would suggest defining custom assembly rules depending on the file extension. (Visual Studio 2008, at least in the Professinal Edition, can generate .rules files that can be distributed). There you can define custom build tools for asm files. Using this approach, you can leave the linker step as is.

In the opposite direction, we used the MASM32 link text as an IDE to help students learn assembly. You can check their batch files, what they do to assemble and link.

+2
source share

instead of batch files, why not use the custom build step defined in the file?

+1
source share

If you are going to use Visual Studio, could you give them a skeleton project in C / C ++ with an entry point for a console application that calls a function that has an empty empty build block and let them fill in their results in it?

0
source share

Why not use the Irvine Guide? The Irvine library is good, and if you want, you can ignore it and work directly with Windows proc. I was looking for such a guide; Irwin was the best solution.

0
source share

All Articles