Question: 6. Write a procedure using RISC-V assembly instructions that is equivalent to the following C function. The procedure should store the base address for
6. Write a procedure using RISC-V assembly instructions that is equivalent to the following C function. The procedure should store the base address for the array and the length of the array in registers x10 and x11 (a0 and al) respectively. Your procedure may freely use any temporary registers, but should not use any saved registers. You should also assume that the return address for the caller to the procedure is stored in the x1 (ta) register. void initialize(long long array[), size t length, long long v) { for(int i = 0; i < length; i++) { array[i] = V; } }
Step by Step Solution
3.49 Rating (156 Votes )
There are 3 Steps involved in it
Heres the RISCV assembly code equivalent to the given C function global initialize initialize a... View full answer
Get step-by-step solutions from verified subject matter experts
