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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
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

Post by answerhappygod »

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 1
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 1 (96.04 KiB) Viewed 40 times
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!
Post Reply