Suppose there's a struct
struct info{
struct stat information;
char * filename
}
Then I set the offset of filename pointer
size_t fOffset = offsetof(struct info, filename);
now what is the fOffset?
And in the SPARC assembly, I want to get the actual string in filename. This is what I wrote so far. The parameter is a pointer of info struct
set fOffset, %l0
ld [%l0], %l1
add %i0, %l1, %l2
ld [%l2], %l2
ldub [%l2], %o0
I thought now %o0 will store the string, but clearly it does not. Someone help me?