title: Keil ARM7 Program That Searches An Array
body: <p>The program requires reading the elements of an array of 10 numbers and count the number of zeros in that array and store it in R7. Here's what I've developed so far...</p>
  
  <pre><code>    AREA addition, CODE, READWRITE
      ENTRY
      LDR R0,=ARR
      MOV R1, #0        ; Loop Iterator
      MOV R2, #0        ; Array Index
      MOV R7, #0        ; Number Of Zeros In The Array
  
  LOP CMP R1, #10
      BEQ EXT
      LDR R3, [R0]
      CMP R3, #0
      BEQ MOVE1
      B CNT
  
  MOVE1 ADD R7, R7, #1
        B CNT
  
  CNT ADD R2, R2, #4
      ADD R1, R1, #1
      B LOP
  
  ARR DCD 3,-5,-1,0,10,0,4,-8,7,6
  EXT
  
      END
  </code></pre>
  
  <p>The problem is that it never enters MOVE1. I really cannot figure out why.</p>
  
  <p>Thanks in advance.</p>