- Consider The C Code Below Where H And J Are Constants Declared With Define 2 5 Points Int Array1 H J Int Array2 1 (34.28 KiB) Viewed 84 times
Consider the C code below, where H and J are constants declared with #define. (2.5 Points) int array1[H] [J]; int array2
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am
Consider the C code below, where H and J are constants declared with #define. (2.5 Points) int array1[H] [J]; int array2
Consider the C code below, where H and J are constants declared with #define. (2.5 Points) int array1[H] [J]; int array2[J] [H]; void copy_array(int x, int y) { array2 [x][y] = array1[y][x]; } Suppose the above C code generates the following x86-64 assembly code: # On entry: # %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 MacBook Pro