NMMA
NMMA

Reputation: 173

How to compile assembly files using vs2008?

I use vs2008 . and need to compile project that include ".asm" files.

how I can do that?

Upvotes: 1

Views: 4458

Answers (3)

Todd
Todd

Reputation: 11

The basic question is more or less answered, but what if you want to do just assembly language in your Visual Studio project? Here is the answer:

  • Start with a General - Empty project.

  • Right-clicking on the project name in the solution explorer, set Custom Build Rules so that the Microsoft Macro Assembler is used.

  • Next, go to Project - Properties. Find the Linker in the dialog box and expand it (click on the +).

  • Under the Linker, select System.

  • On the top line, Subsystem, click the down arrow and choose "Console (/SUBSYSTEM:CONSOLE)."

  • In the same dialog box under Linker, select Advanced.

  • Edit the top line, Entry Point, so that it is the label you used as the starting point of your code. Note: You should not enter the underscore when filling in the Entry Point. VS apparently adds an underscore.

Your environment is now set to do assembly langauge programming as a project.

The procedure works also in Microsoft's free Visual C++ 2008 Express edition which is still downloadable from MS as of the date of this posting.

Good luck and have fun!

Upvotes: 1

Hans Passant
Hans Passant

Reputation: 941455

Right-click the project in the Solution Explorer window, Custom Build Rules, tick "Microsoft Macro Assembler". This ensures that any .asm files you add to your project get compiled with the custom build rule for .asm files.

If you still have problems, do make sure you document the error message you see. They are meant to be helpful.

Upvotes: 2

Shinnok
Shinnok

Reputation: 6389

You will need to make use of MASM. MASM stands for Microsoft Macro Assembler Reference.

Another more straightforward and easier way of accomplishing asm in VS is inlining your asm code into your C/C++ source files.

Upvotes: 0

Related Questions