Answer the given question with a proper explanation and step-by-step solution. Consider the following source code, where k,l and m are constants declared with #define. The struct lnode is as defined as: struct lnode { char *str; // points to 32-character string struct lnode *next; // points to next node address struct lnode *prev; // points to prev node address }; 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: endbr64 movslq %edi, %rdi movslq %edx, %rdx movslq %esi, %rsi movdqu 8(%rsp), %xmm0 movq %rdi, %rax leaq (%rdx,%rdx,2), %rdx salq $6, %rax subq %rdi, %rax salq $4, %rax leaq (%rax,%rdx,8), %rax leaq (%rsi,%rsi,4), %rdx leaq (%rsi,%rdx,4), %rdx leaq (%rax,%rdx,8), %rdx leaq A(%rip), %rax addq %rdx, %rax movq 24(%rsp), %rdx movups %xmm0, (%rax) movq %rdx, 16(%rax) movl $15120, %eax ret Use your reverse engineering skills to determine the values of k,l and m, based on the assembly code. (Hint: The movdqu and movups instructions are dealing with the updating of the array element, not determining the location of the element being updated) Show your work for finding out these values in (HW6-show your work, worth ) 1.k 2.l 3.m

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Answer the given question with a proper explanation and step-by-step solution.

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

struct lnode { char *str; // points to 32-character string struct lnode *next; // points to next node address struct lnode *prev; // points to prev node address };

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: endbr64 movslq %edi, %rdi movslq %edx, %rdx movslq %esi, %rsi movdqu 8(%rsp), %xmm0 movq %rdi, %rax leaq (%rdx,%rdx,2), %rdx salq $6, %rax subq %rdi, %rax salq $4, %rax leaq (%rax,%rdx,8), %rax leaq (%rsi,%rsi,4), %rdx leaq (%rsi,%rdx,4), %rdx leaq (%rax,%rdx,8), %rdx leaq A(%rip), %rax addq %rdx, %rax movq 24(%rsp), %rdx movups %xmm0, (%rax) movq %rdx, 16(%rax) movl $15120, %eax ret

Use your reverse engineering skills to determine the values of k,l and m, based on the assembly code. (Hint: The movdqu and movups instructions are dealing with the updating of the array element, not determining the location of the element being updated) Show your work for finding out these values in (HW6-show your work, worth )

1.k

2.l

3.m

4.​​​​​​​upload your work for determining k, l, m

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education