Question: Give me the process Question 1: Suppose p is a pointer to an array of 4-byte floats at memory address 0x8738. What is the address
Give me the process
Question 1:
Suppose p is a pointer to an array of 4-byte floats at memory address 0x8738. What is the address of p[4]?
Question 2:
longA[M][N]; long
B[N][M]; long foo(long i, long j) { return
A[i][j]+B[j][i]; }
Fill in the values of M and N so that the c code produces this assembly code:
foo: leaq 0(,%rdi,8), %rdx subq %rdi, %rdx addq %rsi, %rdx leaq (%rsi,%rsi,8), %rax addq %rax, %rdi movq B(,%rdi,8), %rax addq A(,%rdx,8), %rax ret
Transcribed image text
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts

A[M][N]; long
B[N][M]; long foo(long i, long j) { return
A[i][j]+B[j][i]; }