Using ASM when compiling x64 C ++ with MSVC10

Due to the fact that MSVC10 does not allow the use of built-in ASM instructions when targeting the x64 architecture, I am looking for any ways to get around such restrictions. I learned from googling that writing and compiling separate ASM modules and then linking them and calling them from C ++ is one way, however, I don’t know how to do it. Are there any other ways if you don't use the compiler's built-in functions? Or how is this done to write / compile / link to individual ASM modules in VS2010?

+3
source share
1 answer

You can use a separate assembler program that will compile the complete assembler source files into object files. As long as you follow the correct calling conventions, you can provide prototypes for functions to use in the C ++ link along with the C ++ and ASM files.

I am using yasm . It uses intel syntax, supports x64 windows and VS2010 integration . It has useful macros and includes features. I must admit that I did not have to use it with VS2008, when the integration worked a little differently, but it should work well with VS2010.

+3
source

Source: https://habr.com/ru/post/1761607/


All Articles