I have the following code:
void * storage = malloc( 4 );
__asm
{
//assume the interger 1 is stored in eax
mov eax, storage //I've tried *storage as well but apparently it's illegal syntax
}
/* other code here */
free(storage);
However, in the code, when I dereference the storage pointer ( as in *(int *)storage ), I do not get 1. So, what is the proper way of storing the value of a register into the memory pointed to by a C++ pointer?