Computers and Technology, 16.03.2020 23:22 james234886
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.
Answers: 3
Computers and Technology, 23.06.2019 06:30
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
Computers and Technology, 24.06.2019 08:00
Can someone work out the answer as it comes up in one of my computer science exams and i don't understand the cryptovariables
Answers: 1
Computers and Technology, 24.06.2019 10:40
Joe needs to see the slide transitions and animations he has applied to his slides in a large view. which presentation view should he use? in which tab would joe find the animations option to make further changes, if any?
Answers: 1
Consider the following source code, where k, l and m are constants declared with #define. The struct...
Mathematics, 14.11.2019 05:31
Social Studies, 14.11.2019 05:31
History, 14.11.2019 05:31
Mathematics, 14.11.2019 05:31
Biology, 14.11.2019 05:31
Social Studies, 14.11.2019 05:31
History, 14.11.2019 05:31
Health, 14.11.2019 05:31
Biology, 14.11.2019 05:31
Biology, 14.11.2019 05:31