Question: Consider the following C program. Assume that the register SP at beginning points to 0x0800. Answer the following questions. (30 points, C language) Consider the
Consider the following C program. Assume that the register SP at beginning points to 0x0800. Answer the following questions.


(30 points, C language) Consider the following C program. Assume that the register SP at the beginning points to Ox0800. Answer the following questions. Assume all variables are allocated on the stack, and in the order as they appear in the program (10 points) Illustrate the content of the stack at the moment before the statement at line 7 is executed (10 points) Comment the code (lines 7 - 14) indicating the result of each statement. Illustrate the content c the stack at the end of execution of the statement in line 14. What are values of variables x, y, z, and myol after execution of this code snippet (as you would see them printed by the corresponding printf statement (10 points) Show assembly language implementation of the statement at lines 7 and 14 unsigned int x int y = -3; long int z = -4; char mych [4]={'A' , , B' ,' C' ,' D'}; unsigned int *p i; long int *p_lii 2 10 p1=p1-2; *p 1 = 10; 12 13 14 11 = &z; *p 11 = *p 11 + Z
Step by Step Solution
There are 3 Steps involved in it
To solve this problem lets break it down step by step Step 1 Illustrate the Content of the Stack Before Line 7 Assuming variables are pushed onto the ... View full answer
Get step-by-step solutions from verified subject matter experts
