views:

39

answers:

1

Due to MSVC10 not allowing the use of inline ASM instructions when targeting x64 architecture, I'm looking for any ways to get around such restrictions. I have learned from googling that writing and compiling separate ASM modules then linking against them and calling them from C++ is one way, however I have no idea how I would do this. Are there any other ways, short of using the compiler intrinsics? Or how does one go about writing/compiling/linking against separate ASM modules in VS2010?

+3  A: 

You can use a separate assembler program which will compile complete assembler source files into object files. So long as you follow the correct calling conventions you can provide prototypes for the functions for use in C++ link the C++ and ASM generated object files together.

I use yasm . It uses intel syntax, supports x64 windows and VS2010 integration. It has useful macro and include features. I must confess that I haven't had to use it since VS2008 when integration worked a bit differently, but it is supposed to work well with VS2010.

Charles Bailey