Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use assembly language x86-64to write a conv() function ,thanks! For this problem, you will implement a function conv) that computes the reversed dot product
Please use assembly language x86-64to write a conv() function ,thanks!
For this problem, you will implement a function conv) that computes the reversed dot product of two arrays. In other words, given a pair of arrays x [n], h[n], it will return x[m] h[n - m - 1] m=0 The Specification The registers %rdi and %rsi will contain the base pointer of the two arrays, and %edx will contain the length of the arrays. Both arrays contain char values, i.e., one byte per value, each in the range [-128, 127 The register %al will carry the return value, the summation as described above. Your code will need to use the imul instruction. Note, however, there is no imulb instruction . As per the function call protocol, you may only use the scratch registers %rax, %rcx, %rdx, %rsi, %rdi, %r8, %r9, %r10 and %r11. You will submit: (a) [7 marks] an electronic copy of your conv.s assembly source. This code will be tested for correct- (b) (3 marks] a hard copy of your conv.s assembly source. Your source should be well documented, ness with a variety of inputs. so that any other programmer could read your code and understand it. Your documentation shall include a synopsis of the algorithm you used to perform the computation For this problem, you will implement a function conv) that computes the reversed dot product of two arrays. In other words, given a pair of arrays x [n], h[n], it will return x[m] h[n - m - 1] m=0 The Specification The registers %rdi and %rsi will contain the base pointer of the two arrays, and %edx will contain the length of the arrays. Both arrays contain char values, i.e., one byte per value, each in the range [-128, 127 The register %al will carry the return value, the summation as described above. Your code will need to use the imul instruction. Note, however, there is no imulb instruction . As per the function call protocol, you may only use the scratch registers %rax, %rcx, %rdx, %rsi, %rdi, %r8, %r9, %r10 and %r11. You will submit: (a) [7 marks] an electronic copy of your conv.s assembly source. This code will be tested for correct- (b) (3 marks] a hard copy of your conv.s assembly source. Your source should be well documented, ness with a variety of inputs. so that any other programmer could read your code and understand it. Your documentation shall include a synopsis of the algorithm you used to perform the computationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started