I try to read several elements from the keyboard, given as input into an array that i have the address loaded into the %edi register. I get a segmentation fault error as soon as i type the first input. The "nodes" variable is previously read using also scanf and i checked and the value of it it's correct. The temp variable is a .space type and i thought about using it to store the data into the array, sequencially. Thanks
set_array:
cmp nodes, %ecx
je array_sum
pushl $temp
pushl $format
call scanf
popl %ebx
popl %ebx
movl temp, %ebx -> i think here is the problem but i don't know why
movl %ebx, (%edi, %ecx, 4)
inc %ecx
jmp set_array