Question

I'll make this short and to the point. The _asm block has been completely stripped when creating 64 bit code in Visual Studio. My question is, where can I find some information on how to use assembly in some code that I can call from my project. Like an assembly file I suppose that has some "optimized" function in which I can call directly in my C++ source.

Was it helpful?

Solution

One approach is to write a C template for your assembler function, then use /FAs to generate assembler source for that function template. You should then be able to use the generated assembler source in place of the C template source and build from there. That way you take care of all the messy error-prone ABI stuff automagically.

OTHER TIPS

If you write an external assembly file then you need to make sure that it supports the calling convention of the compiler. Its not too difficult though. You could, of course, just use intrinsics and let the compiler do some register and instruction reordering for you ...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top