Question: Your code should be well documented with high-level comments. Also, your codes include a synopsis of the algorithm you used to perform the multiplication,please. Thanks!

 Your code should be well documented with high-level comments. Also, yourcodes include a synopsis of the algorithm you used to perform the

Your code should be well documented with high-level comments. Also, your codes include a synopsis of the algorithm you used to perform the multiplication,please. Thanks!

The code provided:

a) mul.s

.globl times times: mov %edi, %eax # remove these two lines before imull %esi, %eax # you start writing your code

ret

b)main.c

#include

unsigned times(unsigned, unsigned);

void main () { unsigned a = 6; unsigned b = 7; printf("The product of %u and %u is %u. ", a, b, times(a,b)); return; }

You will modify the subroutine in mul.s, replacing the two instructions that reside there with your solution The Specification . The register %edi will contain the argurnent a. The register %esi will contain the argument b. . The register %eax will carry the return value, the product of a and b. . You may use registers %rax, %rcx, %rax, %rsi, %rdi, %r8, %r9, %r10 and %r 11 as scratch registers. i.e., you may modify their values without penalty. Plan your register usage accordingly! You may not modify the values of registers %rbx, %rbp, %rsp, %r12, %r13, %r14 and %r15. You may not modify the values of any external memory locations

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!