title: How to properly create an array in ARM assembly?
body: <p>I'm currently learning ARM assembly for a class and have come across a problem where I'd need to use an "array." I'm aware that there is no such thing as an array in ARM so I have to allocate space and treat that as an array. I have two questions.</p>
  
  <ol>
  <li>Am I correctly adding new values to the array or am I merely overwriting the previous value? If I am overwriting the values, how do I go about adding new values?</li>
  <li>How do I go about looping through the different values of the array? I know I have to use <code>loop:</code> but don't know how to use it to access different "indexes."</li>
  </ol>
  
  <p>So far, this is what I've gotten from reading ARM documentation as I've gathered from resources online.</p>
  
  <pre><code>        .equ SWI_Exit,  0x11
  
          .text
          .global _start
  
  _start: .global _start
          .global main
  
          b       main
  
  main:
          ldr     R0, =MyArray
          mov     R1, #42
          str     R1, [R0], #4
          mov     R1, #43
          str     R1, [R0], #4
          swi     SWI_Exit
  
  MyArray: .skip 20 * 4
          .end
  </code></pre>
  
  <p>As a side note, I am using <a href="http://armsim.cs.uvic.ca/" rel="noreferrer">ARMSim#</a> as required by my professor, so some commands recognized by GNU tools won't be recognized by ARMSim#, or at least I believe that is the case. Please correct me if I'm wrong.</p>