Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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. This function

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. 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. 0000000000400527 : 400527: 48 8d 04 37 lea (%rdi,%rsi,1),%rax ________: 48 01 d0 add %rdx,%rax 40052e: 48 8d 0c 76 lea (%rsi,%rsi,2),%rcx ________: 48 c1 e1 04 shl $0x4,%rcx 400536: 48 8d 54 0f 04 lea 0x4(%rdi,%rcx,1),%rdx ________: 48 0f af c2 imul %rdx,%rax ________: c3 retq Your task in this question is to fill in its missing parts, which have been underlined. 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions