Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following source code, where R, S, and T are constants declared with #define: Long A[R][S][T]; long store_ele(long I, long j, long k, long
Consider the following source code, where R, S, and T are constants declared with #define: Long A[R][S][T]; long store_ele(long I, long j, long k, long *dest) { *dest = A[R][S][T]; return sizeof(A); } In compiling this program, GCC generates the following assembly code: long store_ele(long I, long j, long k, long *dest) store_ele: leaq (%rsi, %rsi, 2), %rax leaq (%rsi, %rsi, 4), %rax movq %rdi, %rsi salq dollar6, %rsi addq %rsi, %rdi addq %rax, %rdi addq %rdi, %rdx movq A(,%rdx, 8), %rax movq %rax, (%rcx) mov1 dollar3640, %eax ret Extend Equation 3.1 from two dimensions to three to provide a formula for the location of array element A[i][j][k]. Use your reverse engineering skills to determine the values of R, S, and T based on the assembly code. Consider the following source code, where R, S, and T are constants declared with #define: Long A[R][S][T]; long store_ele(long I, long j, long k, long *dest) { *dest = A[R][S][T]; return sizeof(A); } In compiling this program, GCC generates the following assembly code: long store_ele(long I, long j, long k, long *dest) store_ele: leaq (%rsi, %rsi, 2), %rax leaq (%rsi, %rsi, 4), %rax movq %rdi, %rsi salq dollar6, %rsi addq %rsi, %rdi addq %rax, %rdi addq %rdi, %rdx movq A(,%rdx, 8), %rax movq %rax, (%rcx) mov1 dollar3640, %eax ret Extend Equation 3.1 from two dimensions to three to provide a formula for the location of array element A[i][j][k]. Use your reverse engineering skills to determine the values of R, S, and T based on the assembly code
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started