NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: nobody on July 18, 2009, 09:30:08 PM
-
How would I get MS Visual Studio to understand my program?
Nick
-
Nick,
I'm not sure which program you want to understand if you don't have MS VS already, but if so, have a look at: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=f3fbb04e-92c2-4701-b4ba-92e26e408569 (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=f3fbb04e-92c2-4701-b4ba-92e26e408569)
It's .net, Express version is for free!
But, if you i.e. wanna debug on asm level, you need to buy a licence...
Martin
-
So if I want to compile Assembly in MS VS, I have to buy a VS license?
-
Hi Nick,
If you type "nasm visual studio" into Google, you'll find some information - some of it outdated, about getting VS and Nasm to cooperate. The Win32 build of nasm is no longer named "nasmw.exe", just "nasm.exe". The "compatibility with VS" that some sites mention is simply a case of putting the line number in error messages in parentheses, instead of colons. Use "-Xvc" to enable error reporting in that format. Minor issue, but apparently VS cares...
Beyond that, there are instructions for "installing" Nasm within VS. Add it to "tools->executables", tell VS "custom build"(?), add some "commands" to run Nasm... You might want to add "--PREFIX _" to Nasm's command line if you want to be able to write "myfunction" rather than "_myfunction" in your Nasm source. (optional - some people *like* underscores).
In my world "license" and "buy" don't go together, so I don't know anything about that. Martin has kindly shared his MemoryAndRegisters.dll (find it in the "example code" section here. I don't think that'll allow you to "step" through your code, but you can "dump" values at selected points, which should help a lot. Also, you might look at "Ollydbg" ( http://www.ollydbg.de (http://www.ollydbg.de) ) - a "freestanding" debugger. Might be a way to "integrate" it with VS... or maybe not...
*Some* MS licenses specifically prohibit using their stuff in conjunction with open-source code (constipated, aren't they?). Unless you're doing "commercial" stuff, nobody's going to come to you house and arrest you. If you care, look over the license for "free" VS carefully!
If, by some miracle, you still have trouble, post the exact error message(s) - we may be able to figure it out...
Best,
Frank