Thank you all very much. This code does what I need:
void asm(int *p)
{
__asm
{
mov eax, p;
mov ebx, dword ptr [eax];
inc ebx;
mov dword ptr [eax], ebx;
}
}
Aaargh, of course, now I know what I did wrong, it won't resolve the use of the local variable right, trashing the EAX register.
On the same note however, the online help about the x86 inline assembler states that all registers
but EAX, EDX and EDX need to be explicitly preserved by the assembler function, and as you are using EBX, you should either change that to ECX or explicitly PUSH EBX at the very beginning and the POP EBX as the end of the inline block...
Ralf