algorithmica
algorithmica copied to clipboard
Assembly: Alternative Approach
mov rax, -100 ; replace 100 with the array size
loop:
add edx, DWORD PTR [rax + 100 + rcx]
add rax, 4
jnz loop ; checks if the result is zero
https://github.com/algorithmica-org/algorithmica/blob/master/content/english/hpc/architecture/loops.md
I don't understand why the +rcx is needed? Isn't it enough to add back the 100?