(10 pts) CS 3843 Computer Organization I-HW #05 Name/abc123: Due Wed Jun 27 2018
ID: 3909434 • Letter: #
Question
(10 pts) CS 3843 Computer Organization I-HW #05 Name/abc123: Due Wed Jun 27 2018 1. (8 pts) The following assembly code includes a call to the function "secretFunc" and the content f that same function. a. (2 pt) What is the return address of "secretFunc" b. (6 pts) Comment each line as to what it is doing. The comment should be in plain English as shown 004014FF push OFFFFFF80h push -128, the 2nd parameter of "SecretFunc" NOTE: "push 0xFFFFFF80 to the stack" is not acceptable 00401501 push 00401503 call secretFunc 00401508 add esp, 0040150B mov ebp-11, al ;declare a char in Cfor this 0040150Enop 00401000 secretFunc 00401000 push ebp 00401001 mov ebp, esp Copy stack pointer to ebp to use as a frame pointer for this function. It references b th parameters and local variables. 00401003 push ecx 00401004 ovsxeax, [ebp+8] 2018 06 - CS 3843 Computer Organization Homework Page 1Explanation / Answer
Hello Sir/Madam
Here is the line by line Expalnation of the given program
PUSH and POP can be used to save and restore the values of registers when the register needs to be used for some other function temporarily.
1)Pushes a value to the stack.
2)Pushes a value to the stack.
3)Calls the secretfun.
4)Adds the value 8 with the contents of esp register
5)Moves the contents of al register to ebp-1.
6)nop means no operation.
Hope It works and looking forward to help if have any doubts..
Thank You Sir/Madam.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.