.text .align 2 .globl _sum ; r3 = len ; r4 = addr of arr _sum: mr. r0,r3 ; move register: r0 := r3; where '.' enables ; a CR0 update blelr- 0 ; branch to LR if "less than or equal" in CR0 ; is set, where '-' predicts the branch will ; not be taken mtctr r0 ; move r0 into CTR li r3,0 ; load immediate: r3 := 0 addi r4,r4,-4 ; add immediate: r4 := r4 + (-4) .loop: lwzu r0,4(r4) ; load word with update: r0 := mem[r4 + 4]; ; r4 := r4 + 4 add r3,r3,r0 ; add to sum: r3 := r3 + r0 bdnz .loop ; decrement CTR and branch to loop if not zero blr ; branch to LR