Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!

image text in transcribedimage text in transcribed

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

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

Students also viewed these Databases questions

Question

2. We exchanged phone numbers and e-mail addresses. 1 2 3 4 5

Answered: 1 week ago

Question

1. In what ways has flexible working revolutionised employment?

Answered: 1 week ago