Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

The Accidental Data Scientist

Authors: Amy Affelt

1st Edition

1573877077, 9781573877077

More Books

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago