global array_sum section .text array_sum: push ebp mov ebp, esp mov edx, [ ebp + 8 ] xor eax, eax xor ecx, ecx .for: cmp ecx, [ ebp + 12] jge .endfor add eax, [edx + 4 * ecx ] inc ecx jmp .for .endfor: mov esp, ebp pop ebp ret