Consider the following source code, where R, S, and T are constants declared wit
ID: 441680 • Letter: C
Question
Consider the following source code, where R, S, and T are constants declared with # define: int A[R] [S] [T]; int store_ele(int i, int j, int k, int *dest) { *dest = A [i] [j] [k]; return sizeof(A); } In compiling this program, GCC generates the following assembly code: i at %ebp+8, j at %ebp+12, k at %ebp+16, dest at %ebp+20 mov1 12(%ebp), %edx lea1 (%edx, %edx,4), %eax lea1 (%edx, %eax,2), %eax imu11 Dollars 99, 8(%ebp), %edx add1 %edx, %eax add1 16(%ebp), %eax mov1 A(,%eax,4), %edx 20(%ebp), %eax mov1 %edx, (%eax) Dollars 1980, %eax 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.Explanation / Answer
I purchased Guide to Assembly Language: A Concise Introduction by James T. Streib for my Assembly class. It saved my grade.