Question: (a) Write an equivalent routine in LEGv8 assembly language that computes the sum of an array of longs (represented as 64-bit double words) stored in
(a) Write an equivalent routine in LEGv8 assembly language that computes the sum of an array of longs (represented as 64-bit double words) stored in memory. Assume that X0contains the memory address (pointer in C) of the first long in the array, and X1 containsthe number of elements of the array. The total sum value should be returned in registerX7.The following is a C version of a routine that calculates the sum of longs in an array: long array_sum (long *array-pointer, long array_length) { long i; long sum = 0; for (i = 0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
