Question: Consider the following C declaration: struct Node{ char c; double value; struct Node* next; int flag; struct Node* left; struct Node* right; }; typedef struct

Consider the following C declaration:

 struct Node{ char c; double value; struct Node* next; int flag; struct Node* left; struct Node* right; }; typedef struct Node* pNode; /* NodeTree is an array of N pointers to Node structs */ pNode NodeTree[N]; 

For each of the four C references below, please indicate which assembly code section (labeled A F) places the value of that C reference into register %eax. If no match is found, please write NONE next to the C reference.

The initial register-to-variable mapping for each assembly code section is:

%eax = starting address of the NodeTree array %edx = i 

  1. sall $2, %edx leal (%eax,%edx),%eax movl 16(%eax),%eax 
  2. sall $2,%edx leal (%eax,%edx),%eax movl (%eax),%eax movl 24(%eax),%eax movl 20(%eax),%eax movl 20(%eax),%eax 
  3. sall $2,%edx leal (%eax,%edx),%eax movl 20(%eax),%eax movl 20(%eax),%eax movsbl (%eax),%eax 
  4. sall $2,%edx leal (%eax,%edx),%eax movl (%eax),%eax movl 16(%eax),%eax 
  5. sall $2, %edx leal(%eax,%edx),%eax movl (%eax),%eax movl 16(%eax),%eax movl 16(%eax),%eax movl 20(%eax),%eax 
  6. sall $2, %edx leal (%eax,%edx),%eax movl (%eax),%eax movl 12(%eax),%eax movl 12(%eax),%eax movl 16(%eax),%eax 

Group of answer choices

NodeTree [i] -> flag

[ Choose ] b none e c f d a

NodeTree [i] -> left -> left -> c

[ Choose ] b none e c f d a

NodeTree[i] -> next -> next -> flag

[ Choose ] b none e c f d a

NodeTree [i] -> right -> left -> left

[ Choose ] b none e c f d a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!