c++ - 错误 C2400 : inline assembler syntax error in 'second operand' ; found 'register'

标签 c++ visual-studio-2010 assembly inline-assembly

我在 VC++ 中使用汇编指令作为基于 MACRO 内联的汇编程序 block 时遇到编译错误。

error C2400: inline assembler syntax error in 'second operand'; found 'register'

代码如下:

_asm {\

        mov esi,dword ptr [pMemBlock]\
        sub esp,sizeOfblock\
        mov ebx,sizeOfblock\
        mov shrResult,ebx\
        shr shrResult,2\
        mov ecx,shrResult\
        mov shrResult,0\
        mov edi,esp\
        rep movs dword ptr es:[edi],dword ptr[esi]\
}

问候 乌斯曼

最佳答案

_asm { 行之后的空行将完成宏。它应该被删除或有\就可以了。

关于c++ - 错误 C2400 : inline assembler syntax error in 'second operand' ; found 'register' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5062488/

相关文章:

c++ - 允许指定单独的比较器和排序仿函数的关联容器

c - 在 Microsoft Visual Studio 2010 中设置子项目

assembly - 在编译时从 MASM/MASM64 检测架构

assembly - 虚拟机 Ubuntu 上的 NASM : Cannot execute binary file exec format error

c++ - 如何在测量性能时减少循环开销?

c++ - 如何将函数应用于数组中的所有元素(在 C++ 模板类中)

c# - Silverlight 与 WPF 的关系是什么(如果有的话)?

assembly - 我们如何在汇编代码 (MIPS) 中取消引用指针?

c++ - 我如何根据宏中的类型做出决定?

visual-studio-2010 - 如何从 Visual Studio 2010 C# 项目/解决方案中删除 TFS 连接?