Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases

Authors: Antonio Badia

1st Edition

3030575918, 978-3030575915

More Books

Students also viewed these Databases questions

Question

Know what customers expect from the firm when they complain.

Answered: 1 week ago

Question

Understand why customers complain.

Answered: 1 week ago