Question: I need to draw a stack for the following code and the format is look like this: a = 12 x = ? Saved EBP
I need to draw a stack for the following code and the format is look like this: a = 12 x = ? Saved EBP b = 4 Return @ to h y = 12 Saved EBP p = ? z = 42 Return @ to foo the stack above is just an example. EBP is the register in NASM since the course is related to assembly language. h and foo are the function calls or function names. //////////////////////////////////////////// ... g(2,10,4) ...
and the following C function definition:
int g(int n, int count, int width) { int z, y=2*count; if (width == 0) { // HERE return -1; } z = g(n+5, y, width - 2); z += (width * count - n); return 2*z; } Need help on drawing the stack of the code above.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
