Making assembly function inline in x64 Visual Studio

前端 未结 2 839
庸人自扰
庸人自扰 2020-12-16 02:54

I know that MSVC compiler in x64 mode does not support inline assembly snippets of code, and in order to use assembly code you have to define your function in some external

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-16 03:58

    Since the title mentions Visual Studio and not MSVC, I recommend installing Clang via the Visual Studio Installer. It can be used just like MSVC without needing to configure custom build tasks or anything and it supports inline assembly with Intel syntax and variables as operands.

    Just select "LLVM (clang-cl)" in Platform Toolset from the General section of the property pages in your project and you're good to go.

提交回复
热议问题