Question: The following code, A and B are constants defined with #define: typedef struct { i int x [ A ] [ B ] ; /

The following code, A and B are constants defined with #define:
typedef struct { i
int x[A][B]; /* Unknown constants A and B */
long y;
} str1;
typedef struct {
char array[B];
int t;
short s[A];
long u;
} str2;
void setVal(str1*p, str2*q){
long v1= q -> t;
long v2= q -> u;
p -> y = v1+v2;
}
gcc generates the following code for setVal:
void setVal(str1*p, str2*q)
p in %rdi, q in %rsi
setVal:
movslq 8(%rsi),%rax
addq 32(%rsi),%rax
movq %rax, 184(%rdi)
ret
What are the values of A and B?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!