Vector sum

Write a program that loads n positive 32-bit integers starting at address vect_start, n (vector length) will be stored at address vect_len. Sum all those numbers and save the values at address vect_sum. Store the minimum at address vect_min and the maximum at vect_max.

Input: Vector sum, minimum and maximum.
In: Vector starting at address vect_start, size of the vector at vect_len.
Out: Vector sum at address vect_sum, minimum at vect_min and maximum at vect_max.

Your program will be run with the following arguments: --d-regs --dump-cycles --cycle-limit 5000 --asm submission.S
Your program will be scored by this following metric: Runtime of the program in cycles.

For interactive solution, you can use QtRvSim. The web version of the simulator is located here.
Top Scores (cycles)
  • reference
    362