Hello,
Suppose I have
typedef struct { int i,j,k,l; } A;
A *pa = &(A){10,20,30,40};
...
__asm mov eax,[pa]
after that I want to dereference member k in location pointed to by eax. So I write (I really dont know whether this is the correct way or not) :
__asm mov ecx,[eax+A.k-A]
now I think that the expr A.k-A should better be implement with a macro so I write :
#define mem(s,m) s.m-s
__asm mov ecx,[eax+mem(A,k)]
After using the macro, I got an error. I try to preprocess the code (pocc -e) and found that the above got expanded into
__asm mov ecx,[eax+ A . k - A]
// note the space between A, dot and k
I guess that in asm statement, there'd be no space allowed in a literal (identifier.member in this case) but I think it make the use of the above macro possible. What do you think about this? Any workaround?