News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How to use VS2005 with MASM32?

Started by houyunqing, October 20, 2008, 02:00:38 PM

Previous topic - Next topic

houyunqing

It's really a headache to debug with assembly... i think maybe with visual studio things would be a bit easier, but is there a way to set up visual studio such that it can do the compiling, linking and debugging?

...i used to rely almost completely on Visual Studio and i'm new to assembly. anyone knows the answer please help me! thanks a lot!

GregL

houyunqing,

Yes, it can be done. Search around a bit, especially in this forum. Here is one tutorial: A Tutorial of Writing MASM with VC++ 2005 Express. I would recommend you use Visual C++ 2008 at this point.


gwapo

How to enable intellisense support for ASM file in Visual Studio?

-chris

houyunqing

Quote from: Greg on October 20, 2008, 05:11:59 PM
houyunqing,

Yes, it can be done. Search around a bit, especially in this forum. Here is one tutorial: A Tutorial of Writing MASM with VC++ 2005 Express. I would recommend you use Visual C++ 2008 at this point.


hmm...MASM32 kindda makes me feel safer. The MASM package in VS.NET 2005 produces bigger files. I made my own .rules file and now my VS.NET 2005 is using the MASM32's ml.exe&polink.exe to do the work, but there's a little problem: when I press F11, it debugs with the disassembly of the executable instead of my original MASM code... any way to fix it? or maybe it's just impossible??

houyunqing

Quote from: gwapo on October 21, 2008, 06:24:04 AM
How to enable intellisense support for ASM file in Visual Studio?

-chris
Seems WinAsm Studio has some intellisense features:
http://www.masm32.com/board/index.php?PHPSESSID=dde6ccffb1c3cfba83b60dba5b5f0d97&topic=189.0

There is a VS.Net 2003 Intellisense addin for MASM, but the download link isn't working
http://www.masm32.com/board/index.php?topic=2628.0

GregL

Here is some more information on using Visual Studio with MASM: Getting started with MASM. You need to sift through it, there's some good information in there.

Quote from: gwapoHow to enable intellisense support for ASM file in Visual Studio?

Intellisense is not supported for MASM. You can get it to do Syntax Highlighting by editing the usertype.dat file, it goes in ...\Common7\IDE directory and contains a list of keywords that you want highlighted.

Quote from: houyunqing... when I press F11, it debugs with the disassembly of the executable instead of my original MASM code... any way to fix it?

You need to do a debug build. ml.exe /Zi, link.exe /DEBUG.


Note:
I don't use Visual Studio for MASM programming, I prefer other methods. I do use it all the time for debugging MASM programs though. It's the best debugger IMO.


houyunqing

Quote from: Greg on October 21, 2008, 07:28:48 PM
You need to do a debug build. ml.exe /Zi, link.exe /DEBUG

eh...i certainly did a debug building, otherwise VS.NET would have reported something like "debugging information not found"

When you debug using Visual Studio, do you debug with the original masm code or the executable's disassembly?

Is it because I'm using MASM32 instead of MASM to do the assembling and linking so it becomes not supported by Visual Studio?

GregL

QuoteWhen you debug using Visual Studio, do you debug with the original masm code or the executable's disassembly?

After doing a debug build, load the.exe file into Visual Studio. It will display the source code, the disassembly or both depending on your selection. From the command-line or a shortcut use VCExpress.exe filename.exe /debugexe (this is for Visual C++ 2008 Express).

QuoteIs it because I'm using MASM32 instead of MASM to do the assembling and linking so it becomes not supported by Visual Studio?

That shouldn't matter as long as you are using ml.exe and link.exe and doing a debug build.  If you are using a different assembler or linker, you will only see the disassembly, as it doesn't produce the correct debug information format.

IIRC The MASM32 Editor doesn't have a debug build on the menu, unless you have added one.


houyunqing

ah! thanks a lot! it's the problem with the polink.exe. it doesn't generate the format that's supported by Visual Studio
i changed the the linker to link.exe and it's working now!
pressing F5 to start debugging normally makes life so much easier

GregL