News for hackers. Stuff that matters.
Re:Does a compiler use all x86 instructions? (2010) by efaref on Thursday August 25, 2016 @08:26AM (#12358456)
Yes, I think it was designed in particular for determining addresses of fields within structures and variables on the stack, for example if you had:

    struct foo
    {
       int field1;
       int field2[10];
    }
Then an access like:

    fooptr->field2[index]
Would compile to:

    fooptr + sizeof(int) * index + offsetof(struct foo, field2)
Which is:

    lea $4(fooptr,index,4)

There are no comments on this comment yet.