Hello All,
I am looking for the Assembler directive to codify the structure members' address offsets in portable (auto-recomputable) way. Only at assemble I want the assembler to compute the offsets rather thanme hard-coding their offsets into my assembly program. For example, the members of a structure are accessed by the following manner, where their offsets like 0 and 1 (array indices) are used:
MOV AL,*+XAR5[0] ; |32|
SUB AL,*+XAR4[1] ; |32|
struct mystr {
int a, b;
} X;
struct mystr *p = &X;
main()
{
p->a = p->a -p->b;
}
a portion of the compiled code in assembly looks like below:
MOVL XAR5,@_p ; |32|
MOVL XAR4,@_p ; |32|
MOV AL,*+XAR5[0] ; |32|
SUB AL,*+XAR4[1] ; |32|