; sum_0.asm
section .data
section .text
global sum_0
sum_0:
push rbp
mov rbp, rsp
push rbx
sumLoop:
add eax, dword[rdi+rbx*4]
inc rbx
cmp rbx, rsi
jl sumLoop
mov rbx, qword[rbp+16]   ; get sum address
mov dword[rdx], eax      ; return sum
pop rbx
pop rbp
ret
