Question: 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


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.
1. Which lines of code correspond to the for loop of foo?
2. Which register is used to hold the variable i of foo?
3. What is the memory address of the variable i of foo?
4. What is the beginning address of array B?
5. What is the addressing mode for the constant BUF_SIZE when it is used as loop bound?
6. What is the addressing mode for the constant 5?
7. What is the addressing mode used to access each element of B in the loop?
8. What does the code on line 9 (sub esp, 64) do?
Examine the following C code. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
