Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 09:30, rowdycar313p0ao5k
[java] create an application called registrar that has the following classes: a. a student class that minimally stores the following data fields for a student: - name - student id number - number of credits - total grade points earned and this class should also be provides the following methods: - a constructor that initializes the name and id fields - a method that returns the student name field - a method that returns the student id field - methods to set and retrieve the total number of credits - methods to set and retrieve the total number of grade points earned. - a method that returns the gpa (grade points divided by credits) b. an instructor class that minimally stores the following data fields for an instructor: - name - faculty id number - department the following methods should be provided: - a constructor that initializes the name and id fields - methods to set and retrieve the instructor’s department. c. a course class that minimally stores the following data for a course: - name of the course- course registration code- maximum number of 35 students- instructor- number of students- students registered in the course (an array)the following methods should also be provided: - a constructor that initializes the name, registration code, and maximum number of students- methods to set and retrieve the instructor- a method to search for a student in the course; the search should be based on an id number.- a method to add a student to the course. if the course is hill, then an exception with an appropriate message should be raised (try creating your own exception class for this). also, be sure that the student is not already registered in the course. the list of students should be in the order that they registered.- a method to remove a student from the course. if the student is not found, then an exception with an appropriate message should be raised (use the same exception class mentioned a method that will allow course objects to be output to a file using object serialization- a method that will allow course objects to be read in from a file created with object serializationyou will note that the student and instructor classes described above have some commonality. create aperson class that captures this commonality and uses it as a base class for student and instructor. this class should be responsible for the name and id fields and also provide atostring method that returns a string of the form name, id. this will be the inheritedtostring method for the student and instructor classes.1. draw a uml diagram for diss application.2. implement the previous classes in java. write a main program that can serve as a test class that tests all of the methods created and demonstrates that they are working
Answers: 2
image
Computers and Technology, 23.06.2019 12:00, deflox74
What does the level 1 topic in a word outline become in powerpoint? a. first-level bullet item b. slide title c. third-level bullet item d. second-level bullet item
Answers: 1
image
Computers and Technology, 24.06.2019 01:00, summerjoiner
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
image
Computers and Technology, 24.06.2019 02:30, talia43
Assume a class window with accessor method getwidth that accepts no parameters and returns an integer. assume further an array of 3 window elements named winarr, has been declared and initialized. write a sequence of statements that prints out the width of the widest window in the array.
Answers: 2
Do you know the correct answer?
Consider the following source code, where k, l and m are constants declared with #define. The struct...

Questions in other subjects:

Konu
Mathematics, 24.08.2019 05:00
Konu
Mathematics, 24.08.2019 05:00
Konu
Social Studies, 24.08.2019 05:00