title: Loading Values From An Array In Assembly Language
body: <p>I am working on one of the simple codes assigned for a ARM microprocessor course I'm taking. I am having a slight issue with getting my code to load a value of an array to compare using Keil. The program is supposed to compare 5 numbers and then store values if the comparison is true. When I run my program it will not load array values that I declared. My professor isn't much help either and doesn't seem to know why it's not working properly.</p>
  
  <p>Here's what I have done so far. I also think my PUSH is wrong but I can probably figure that out after I at least get the array to load. I should be pushing those values onto the stack but I am pretty sure I'm just loading values in registers instead. </p>
  
  <pre><code>    AREA    main, CODE, READONLY
      EXPORT __main 
      ENTRY
  
  __main   PROC
  MOVS r5, #0
  LDR r0, =NUMB
  loop1
  LDR r1, [r0]
  CMP r5, #5
  BEQ stop
  
  loop
  CMP r1, #10
  BLT low10
  CMP r1, #100
  BLT mid
  CMP r1, #255
  BLT high100
  
  low10
  PUSH {r2}
  MOVS r2, #2
  ADDS r5, #1
  B loop1
  
  mid
  PUSH {r3}
  MOVS r3, #0
  ADDS r5, #1
  B loop1
  
  high100
  PUSH {r4}
  MOVS r4, #1
  ADDS r5, #1
  B loop1
  
  stop B stop
  
      ENDP    
  
      AREA myDATA, DATA, READWRITE 
      ALIGN
  NUMB    DCD 1,11,111,11,1
          END
  </code></pre>