Original Post
Ok, here''s my problem. I didn''t want to have tons of parameters passed to many functions, so I decided to create a container class, which has all its members within. Thus calling the functions would require no parameters and they would just have to use the class members as parameters. I hope I''m clear enough.
Now, the problem is, these functions are inline ASM, so when I actually want to get the class member''s content, I found out that I have to load the this pointer and add the offset which is contained in the members, instead of their content. Is there an efficient way to use class members in an ASM routine?
Here''s a quick example of what I mean:
class test
{
private:
int a;
char * ptr;
void asmproc ()
{
__asm
{
mov eax, a // this will move the offset of a instead of its value
mov ebx, this
mov eax a[ebx] // this will work correctly, but I have to sacrifice a register all the time for this to work
}
};
public:
void dosomething (int a, char * ptr)
{
this->a = a;
this->ptr = ptr;
asmproc();
};
}