简体   繁体   English

错误C2400:“第二个操作数”中的内联汇编语法错误; 找到“注册”

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

I am facing compilation error while working with assembly instructions in VC++ as MACRO inline based assembler blocks. 我在使用VC ++中的汇编指令作为基于MACRO内联的汇编程序块时遇到编译错误。

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

Here is the code: 这是代码:

_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]\
}

Regards Usman 问候乌斯曼

That blank line after the _asm { line will complete the macro. _asm {行之后的空白行将完成宏。 It should be deleted or have \\ on it. 它应该被删除或上面带有\\。

It should be 它应该是

_asm {\
    __asm mov esi,dword ptr [pMemBlock]\
    __asm sub esp,sizeOfblock\
    ...

See this msdn page . 请参阅此msdn页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM