Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following code fragment where the right-hand side of the assignments in func are to be completed by answering this question (and the next
Consider the following code fragment where the right-hand side of the assignments in func are to be completed by answering this question (and the next question):
The compiler generates the following assembly code for the body of func:
push %ebp mov %esp,%ebp mov 0x8(%ebp),%eax lea 0x4(%eax),%edx mov 0xc(%ebp),%eax mov %edx,(%eax) mov 0x8(%ebp),%eax mov 0x8(%eax),%eax mov 0xc(%ebp),%edx mov %eax,0x4(%edx) mov 0x8(%ebp),%eax mov 0x4(%eax),%eax mov 0xc(%ebp),%edx mov %eax,0x8(%edx) mov 0x8(%ebp),%eax mov 0xc(%ebp),%edx mov %edx,0xc(%eax) mov 0xc(%ebp),%eax movl $0x0,0xc(%eax) pop %ebp ret
what is the value of A, B and C, D and E respectively?
typedef struct point i float *p; struct -i float x:; float y; struct point* next; point; void func(point *spl, point* sp2) I sp2->p = A; spi-next sp2-next D; E; - int mainO point *init, *final; // assume init has been initialized to some value func(init, final); return 0Step 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