Reputation: 2267
__asm
{
mov bl, byte [0x0068F51C]
call 0x004523C0
}
This code gives this error:
main.cpp(57): error C2400: inline assembler syntax error in 'second operand'; found '['
main.cpp(58): error C2415: improper operand type
Line 57 is the line with the mov instruction. I don't see what I'm doing wrong here, especially the call instruction. Can somebody tell me how to remove this error?
Upvotes: 0
Views: 1459
Reputation: 490018
The obvious question would be why you think you want to do this. For the first instruction, the problem is purely syntactical, and trivial to fix:
mov bl, byte ptr [0x0068F51C]
There are a few ways of fixing the second instruction. One possibility would be like this:
mov eax, 0x004523C0
call [eax]
The cleaner/more direct methods of calling an arbitrary address use assembler directives that I don't think are supported by the inline assembler, so at least offhand I'm not sure of a cleaner way to handle this particular one.
Upvotes: 2