I am facing compilation error while working with assembly instructions in VC++ as MACRO inline based assembler blocks.
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. 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With