














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















struct rec { int i; int a[3]; int* p; };
struct rec { int i; int a[3]; int* p; };
movl %eax,0(%edx) # Mem[r+0] = val void set_i(struct rec* r, int val) { r->i = val; }
leal 0(,%ecx,4),%eax # 4idx leal 4(%eax,%edx),%eax # r+4idx+ int* find_address_of_elem (struct rec* r, int idx) { return &r->a[idx]; }
struct rec { int i; int a[3]; int* p; };
&(r->a[idx])
movl 4(%eax,%edx,4),%eax # Mem[ r+4idx+4 ] int find_address_of_elem (struct rec* r, int idx) { return &r->a[idx]; }
struct rec { int i; int a[3]; int* p; };
p p+1 p+9 p+ struct S1 { char c; double v; int i; } * p;
p+0 p+
p+16 p+ struct S1 { char c; double v; int i; } * p; struct S2 { double v; int i; char c; } * q; q+
q+8 q+
q+
p+0 p+
p+16 p+ q+
q+8 q+
q+
union U { char c; int i[2]; double v; } *up; struct S { char c; int i[2]; double v; } *sp; c 3 bytes^ i[0] i[1] 4 bytes^ v sp+0 sp+4 sp+8 sp+16 sp+ c i[0] i[1] v up+0 up+4 up+