Question: I need help for assembly code ...... It is not a lot but it is short answers. Examine the source code and the assembly language.

 I need help for assembly code ...... It is not a

I need help for assembly code ...... It is not a lot but it is short answers. Examine the source code and the assembly language. Relate the assembly code back to the source code. For example, can you identify the section of the assembly code that corresponds to the for loop in function foo? After you have developed an understanding of the assembly code answer the following questions. When a question asks for the address of a variable, your answer should be of the form of the effective address of the variable. For example, (ebp-4), eax. file "code.c" .intel_syntax noprefix .text globl foo -type foo, Ofunction 1) Which lines of code correspond to the for loop of foo? 2) Which register is used to hold the variable i of foo? 1. 2. 3. 4. 5. 6. foo: 7. 8. O 9. 9. 10. . 11. 12. 13. 14. 15. 16. 17. 18. 19 20. 21. 22. 23 24. push ebp 3) What is the memory address of the variable i of foo? mov ebp, esp sub esp. 64 4) What is the beginning address of array B? mov DWORD PTR [ebp-4), O jmp .L2 5) What is the addressing mode for the constant BUF SIZE when it is used as loop bound? .L3: 6) What is the addressing mode for the constant 5? mov eax, DWORD PTR Cebp-4) mov DWORD PTR Cebp-56+eax 4], 5 7) What is the addressing mode used to access each element of B in the loop? add DWORD PTR [ebp-4), 1 L2: 8) What does the code on line 9 ("sub esp, 64") do? cmp DWORD PTR [ebp-4), 12 jle .L3 mov eax, DWORD PTR [ebp-4] Please, can you answer 8 questions? GOOD LUCK leave ret .size foo, .-foo -globl main type main, Ofunction main: push ebp mov ebp, esp call foo mov eax, 0 pop ebp ret .size main, main .ident "GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 20170516" . section .note. GNU-stack,,progbits 25. 26 27 28 29. 30. 31. 32. 33. 34

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!