subject

Consider the following source code, where k, l and m are constants declared with #define. The struct lnode is as defined from problem 1, repeated here:

struct lnode {
struct lnode *next; // points to next node address

char *str; // points to 16-character string

};

You will need to determine the values for k, l and m, which are the dimensions of a 3-D array named A.
struct lnode A[k][l][m];
int store_ele(int h, int i, int j, struct lnode dest) {

A[h][i][j] = dest;
return sizeof(A);

}

On compiling this program (with gcc -O2 -S -fno-asynchronous-unwind-tables), gcc generates the following assembly code for the store_ele function:

store_ele:
movslq %esi, %rsi
movslq %edi, %rdi
movslq %edx, %rax
imulq $343 %rdi, %rdi
leaq (%rsi,%rsi,2), %rdx
salq $4, %rdx
addq %rsi, %rdx
addq %rdi, %rdx
addq %rax, %rdx
leaq A(%rip), %rax
salq $4, %rdx
addq %rax, %rdx
movl $268912, %eax
movq %rcx, (%rdx)
movq %r8, 8(%rdx)
ret
Use your reverse engineering skills to determine the values of k, l and m, based on the assembly code. Show your work and the steps required to determine k, l and m on the next page as answer 2.2. You may attach additional pages as needed. Place the discovered values for k, l and m in 2.1

I know that the maximum size of the array is 268912 and since its a struct its gonna be 16.

K*l*M*16 = 268912 and if dive 268 912 will get 16807. But I really dont know how to find K, L and M.

There's no other information that I can be added..This is the full question will all of the information.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 23.06.2019 09:30
Write an essay on online collaboration, how to do it, the challenges, resolving the challenges, and consider whether the risks are greater than rewards. ( need )
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
question
Computers and Technology, 24.06.2019 12:30
Select all that apply. what two keys listed below should you use to enter data in an excel worksheet? tab backspace enter right arrow
Answers: 2
You know the right answer?
Consider the following source code, where k, l and m are constants declared with #define. The struct...
Questions
question
History, 12.03.2020 08:22
question
Mathematics, 12.03.2020 08:22
question
Mathematics, 12.03.2020 08:25
question
Mathematics, 12.03.2020 08:28