Question: Machine level instructions and their memory location First, download the A 3 _ Q 2 _ Table.pdf or A 3 _ Q 2 _ Table.docx

Machine level instructions and their memory location
First, download the A3_Q2_Table.pdf or A3_Q2_Table.docx from our course web site (under Assignment 3) and open the file with the format you would like to work with: pdf or Word.
Consider a function called arith, defined in a file called arith.c and called from the main function found in the file called main.c (all these files are posted under Lecture 12). This function arith performs some arithmetic manipulation on its three parameters. Now imagine we compile main.c and arith.c files and create an executable called ar. Now, imagine we execute the following command:
objdump d ar > arith.objdump
The file arith.objdump is the disassembled version of the executable file ar. We display the partial content of arith.objdump below as well as in the file A3_Q2_Table.pdf (or A3_Q2_Table.docx) you downloaded above.
0000000000400527 :
400527: 488d 0437 lea (%rdi,%rsi,1),%rax
______: 4801 d0 add %rdx,%rax
40052e: 488d 0c 76 lea (%rsi,%rsi,2),%rcx
______: 48 c1 e104 shl $0x4,%rcx
400536: 488d 540f 04 lea 0x4(%rdi,%rcx,1),%rdx
______: 480f af c2 imul %rdx,%rax
______: c3 retq
Your task in this question is to fill in its missing parts, which have been underlined. In other words, complete the Table in the A3_Q2_Table.pdf (or A3_Q2_Table.docx) document you downloaded above.
Hint: 400527 is the memory address (in hex) of the first byte of the first instruction of the function arith above (i.e., the instruction lea (%rdi,%rsi,1),%rax).

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!