I'm developing on Mac OS X (FreeBSD)
here is the code
section .data
v dd 72,54, 89, 21, 0, 12
n equ 6
section .bss
max resd 1
section .text
global _start
_start:
mov eax, 0
mov ebx, [v]
mov cx, n
dec cx
change_max:
mov ebx, [v+eax*4]
loop lp
lp:
inc eax
cmp ebx, [v+eax*4]
jl change_max
loop lp
return_max:
mov [max], ebx
exit:
push dword 0
mov eax, 0x1
sub esp, 4
int 0x80
I get a Segmentation fault:11 and I can't understand why, any clue?