Consider the C code below, where H and J are constants declared with #define. int array 1[H][J] int array2 [J][H] void c
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Consider the C code below, where H and J are constants declared with #define. int array 1[H][J] int array2 [J][H] void c
Consider the C code below, where H and J are constants declared with #define. int array 1[H][J] int array2 [J][H] void copy_array(int x, int y){ array2 [x][y]= array1 1[y][x] \} Suppose the above C code generates the following x86−64 assembly code: # \%edi = x #% esi = y copy_array: movslq \%esi,\%rsi movslq \%edi,\%rdi movq \%rdi, \%rax salq $4,% rax subq \%rdi, \%rax addq \%rsi, \%rax leaq (\%rsi,\%rsi,4), \%rsi leaq (\%rdi,\%rsi,2), \%rsi movl array1(,\%rsi,4), \%edx movl \%edx, array2(,\%rax,4) ret Assuming sizeof(int) =4, what are the values of H and J ? a. H=10 J=3 b. H=10 J=15 c. H=3 J=8 d. H=15 J=10 e. H=3 J=10 f. H=15 J=8
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!