I'm currently learning about basic assembly language via RISC-V, and I'm slightly confused on valid ways to loop through an array.
If we're given a0 as a pointer to an integer array, would this suffice to move to the next element?
- lw s0, 0(a0) #pointer to array is stored in s0
- lw s0 4(s0) #call this each time you want to move to the next element?
If I would want to modify the actual value of the element at the location as well, can I simply use sw?
I also know using slli/srli also allows you to shift, can anyone explain that concept?
Thank you!