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
-
sall $2, %edx leal (%eax,%edx),%eax movl 16(%eax),%eax
-
sall $2,%edx leal (%eax,%edx),%eax movl (%eax),%eax movl 24(%eax),%eax movl 20(%eax),%eax movl 20(%eax),%eax
-
sall $2,%edx leal (%eax,%edx),%eax movl 20(%eax),%eax movl 20(%eax),%eax movsbl (%eax),%eax
-
sall $2,%edx leal (%eax,%edx),%eax movl (%eax),%eax movl 16(%eax),%eax
-
sall $2, %edx leal(%eax,%edx),%eax movl (%eax),%eax movl 16(%eax),%eax movl 16(%eax),%eax movl 20(%eax),%eax
-
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started