Question: 1. Write an ARMv8 assembly function (min_val) to find the smallest value from an array of n 64-bit values. The n values of the
1. Write an ARMv8 assembly function (min_val) to find the smallest value from an array of n 64-bit values. The n values of the array are stored as a static array value in the data section. The inputs addr and len to the function are passed using the register X1 and X2 respectively and the minimum value of the array is returned using the register XO. The inputs addr is the base address of the static array and len is the length of the static array. Write a ARMv8 assembly program (main) to test the function. The user input n (length of static array) is in register X20 and store the returned smallest value in X21. Assume all the values are signed 64-bit non-zero positive integers and all the registers are used by the caller function to store some data before calling the function. Assemble, test, and simulate the assembly code using DS-5 simulator. Do not upload the entire DS-5 project. Only upload the assembly file (.S file) from the DS-5 project to Canvas. Comment your assembly code.
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
Heres the ARMv8 assembly code for the minval function and main program Data section data array space 8 8 allocate space for an array of 8 64bit values ... View full answer
Get step-by-step solutions from verified subject matter experts
