Jump to content

  • Log In with Google      Sign In   
  • Create Account

Using NASM with VS 2010


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 assainator   Members   -  Reputation: 685

Like
0Likes
Like

Posted 18 June 2011 - 08:59 AM

Does anybody have any idea how to let Visual Studio 2010 assemble my assembly files with NASM? I have been searching but can't find it.

I have found solutions for Visual Studio 2008 but those won't work in the 2010 version.

Also, I have read about custom build rules, so I could add a custom build rule for NASM, but they look really complicated. Is there a tutorial or simple explanation about them?

Thanks in advance,
assaintor
"What? It disintegrated. By definition, it cannot be fixed." - Gru - Dispicable me

"Dude, the world is only limited by your imagination" - Me


Sponsor:

#2 wqking   Members   -  Reputation: 756

Like
1Likes
Like

Posted 19 June 2011 - 01:43 AM

I didn't touch any pure assembly stuff for more than 6 years, so maybe my suggestion wont' work.

How about,

1, In Pre build, call NASM to assembly all your .asm files and generate .obj files. Maybe via a makefile so no need to build all .asm files each time.
2, Let VC compiles all non-asm stuff.
3, Let VC links the .obj files generated by NASM.

I can't test it since I only have VC 2008 Express.

If it won't work, how about put your .asm files to another project and generate .lib file and let VC links to it?

One off topic question, is it really necessary to use pure .asm files? Is the VC inline asm support not enough?

http://www.cpgf.org/
cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.
v1.5.5 was released. Now supports tween and timeline for ease animation.


#3 e‍dd   Members   -  Reputation: 2105

Like
3Likes
Like

Posted 19 June 2011 - 06:30 AM

Have you tried following this example for MASM?

#4 assainator   Members   -  Reputation: 685

Like
1Likes
Like

Posted 19 June 2011 - 10:58 AM

I didn't touch any pure assembly stuff for more than 6 years, so maybe my suggestion wont' work.

How about,

1, In Pre build, call NASM to assembly all your .asm files and generate .obj files. Maybe via a makefile so no need to build all .asm files each time.
2, Let VC compiles all non-asm stuff.
3, Let VC links the .obj files generated by NASM.

I can't test it since I only have VC 2008 Express.

If it won't work, how about put your .asm files to another project and generate .lib file and let VC links to it?

One off topic question, is it really necessary to use pure .asm files? Is the VC inline asm support not enough?



Thanks for the responses!
I didn't think of using libraries, which is probably the best way.

@wqking: It's for learning purposes, I want to learn to program functions in asm that can be called from a C program.


@edd2: No I haven't yet, first wanted to know if there was an easier solution. For now I'll settle on using libraries, when I've got more time I'll try to read the article and create a ruleset nasm.




EDIT:


I was to curious about rulesets so I used page edd2 suggested. I have it working for now. There are still some commandline options I have to include but I'm in no hurry.

Thanks edd2 for just giving me that little push I needed.



"What? It disintegrated. By definition, it cannot be fixed." - Gru - Dispicable me

"Dude, the world is only limited by your imagination" - Me





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS