ARM assembly loop

Viewed 58018
for (int i = 0; i < 10000; i++)
  a[i] = b[i] + c[i]

What does the ARM assembly for this high level language look like?

Edit: I'm also assuming the base address of A is in R8, the base address of B is in R9, and the base address of C is in R10 and A,B,C are all int arrays

Much appreciated

I tried:

MOV  R0, #0  ; Init r0 (i = 0)

Loop:

        a[i] = b[i] + c[i]   //How to fix this? 

        ADD  R0, R0, #1 ;Increment it

        CMP  R0, #1000 ;Check the limit

        BLE  Loop  ;Loop if not finished
4 Answers
Related