numbers DCD 50, 10, 40, 30, 20 LDR R0, =numbers ; R0 has base address (beginning) of array MOV R1, #5 ; R1 is number of items MOV R2, #0 ; R2 is final sum MOV R3, #0 ; R3 is current index LOOP CMP R3, R1 ; compare index against size (no <, >, == at this point) BEQ DONE ; leave when done (pick the right comparison for DONE) LDR R4, [R0, R3, LSL #2] ; R4 is current item from memory: R4=*(R0+R3*4) in C, or R4=R0[R3*4] in Java ADD R2, R2, R4 ; update sum (R1) with item (R4) ADD R3, R3, #1 ; update index by 1 for next cell BAL LOOP ; go back to check if done DONE