There are two seperate parts to the problem the first is giving the purpose to e
ID: 3762026 • Letter: T
Question
There are two seperate parts to the problem the first is giving the purpose to each piece of the disassembled code(PLEASE GO OVER EACH PART OF THE TABLE.) and then writing a C code for what bar ( ) would do. If you ned more information just ask/tell me what to do. Please keep the code basic because we are not in very advanced topics and I keep getting codes that are not what I need. Thanks!
I have a assembly code for bar here is the general structure of the function:
and the assembly code:
I need to fill this table with the purpose of each instruction (the why) & (PLEASE GO OVER EACH PART OF THE TABLE.) :
And then I need to write a C function that does what bar ( ) does. I can use my own parameters for var(s) and local var(s). Please keep the code basic because we are not in very advanced topics and I keep getting codes that are not what I need.
int bar some number of args /) Some number of local vars / return something */i int foo some number of args /) Some number of local vars / /*Some code, including call (s) to bar) * return something */i int main ) /*Some number of local vars, including call (s) to foo) return(0) return ( 0 ) ;Explanation / Answer
push %ebp means It stores the previous base pointer (ebp) and set the base pointer as it was the top of the stack. This means that all the stack contents is saved down the stack, so the function can push/pop in the stack.
mov %esp,%ebp meansMoving esp into ebp is done as a debugging aid and in some cases for exception handling. ebp is often called the frame pointer.
ret means
transfer control to the return address located on the stack
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.