Question: Write a function in assembler that will add the squared values of each element in the array. For example, uint64_t a[4] = {9, 1, 2,

Write a function in assembler that will add the squared values of each element in the array.

For example, uint64_t a[4] = {9, 1, 2, 4}; cout << sumsq(a, 4) << ; // should print 81+1+4+16 = 102

This function will be called in a c++ file along with the assembler code:

uint64_t sumsq(const uint64_t a[], uint32_t len);

Note that the name is _Z5sumsqPKyj (in this case the array is Pointer to Constant because it is declared const)

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!