title: ARM assembly error undefined reference to `a'
body: <p>I am running ARM assembly code to initialize array a. I get the error saying
  undefined reference to `a'. I am using gcc to compile
  Here is the code   </p>
  
  <pre><code>.text
  .global main
  main:
          ldr r0, addr_of_a    // r1 = *a
          mov r1, #0           // Index i
  loop:   str r1, [r0]         // a[i] = i
          add r0, r0, r0, lsl #2   // Increment address by 4 bytes
          add r1, r1, #1       // r1 = r1 + 1
          cmp r1, #100
          bne loop
  end:
          mov r0, r1
          bx  lr
  addr_of_a: .word a
  </code></pre>