Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following t.c and ts.s files Under Linux, use gcc -m32 t.c ts.s to generate an a.out Run a.out as a.out one two three
Given the following t.c and ts.s files Under Linux, use gcc -m32 t.c ts.s to generate an a.out Run a.out as a.out one two three > outfile DO the requirements 1 to 5 as specified bel ow # ts.s file: getebp global getebp movl ret %ebp, %eax /xxxxxxxxxxxxx t.c filxxxxxxxxxxxxxxx*/ #include #include int FP: int main(int argc, char argv ], char env ]) int a,b,c; printf("enter mainn"); pr intf("&argc=%x argv=8x env-Xctin", &argc, argv, printf("&a-X8x8b-%8x &c-X8x n'', &a, &b, &c); env); (1). Write C code to pr int values of argc and argv[] entries a-1 b-2 A(a,b); c-3; printf("exit mainn"; int A(int x, int y) int d,e,f printf("enter An") // write C code to PRINT ADDRESS OF d, e, f B(d,e); printf("exit Atn"); int B(int x, int y) int g,h,i printf("enter B") // write C code to PRINT ADDRESS OF g,h, i C(g,h); printf("exit Bn"); int C(int x, int y) int u, v, w, i, p; printf("enter Wn") // write C cdoe to PRINT ADDRESS OF u,v,w,i,p; FP (int )getebp); // FP stack frame pointer of the C) function (2). Write C code to print the stack frame ink list p = (int *)&p; (3). Print the stack contents from p to the frame of main) YOU MAY JUST PRINT 128 entries of the stack contents (4). On a hard copy of the print out, identify the stack contents as LOCAL VARIABLES, PARAMETERS, stack frame po inter of each function
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