22. (4 pts) What 2 operations are performed by a call instruction? 23. (4 pts) W
ID: 3915952 • Letter: 2
Question
22. (4 pts) What 2 operations are performed by a call instruction? 23. (4 pts) What 2 operations are performed by a ret instruction? 24. (14 pts) Examine the following assembly instructions, and answer the subsequent questions 0020 mov eax, [ebp +0x10] value here0x00000052 0023 mov ecx, [ebp + 0x08] ; value here = 0x00000090 0026 cmp al, cl 0028 jg label label is at address 003C, jg is signed 002A nop 002B 003C label: sub al, cl (3 pts) Inside a function, assuming that cbp is used for the stack frame, what is at the address cbp+0x10 with respect to a C function call? a. b. (2 pts) Given a signed operation, al is greater than, less than, equal to) cl? c. (3 pts) what is the address from which the offset to the jg is calculated? d. (3 pts) What is the value of the offset for the jg instruction? (3 pts) What is the difference between the "cmp" instruction at address 26 and the "sub" instruction at address 3C? e. f. (2 pts) Suppose ecx = 0x12345678 prior to executing the code above. What is the new value after executing the code at address 23. 2017 01-CS 3843 Computer Organization-Exam #2 Page 3Explanation / Answer
22. Two operations performed by CALL instructions :
a) Pushes return address to stack i.e. address stored in program counter(PC)
b) Transfers the program control to the called procedure.
23. Two operations performed by RET instructions :
a) Pop the return address from the stack
b) Jump to the popped address
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.