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