I have a following code, running on the jdoodle.com:
section .text
global _start
_start:
mov eax, [array]
mov ebx, [array+1]
add eax, ebx
mov [sum], eax
jmp .printthis
mov eax, 1
int 0x80
ret
.printthis:
mov ecx, sum
mov edx, 1
mov ebx, 1
mov eax, 4
int 0x80
ret
section .data
array db 1,2,3,4,5
segment .bss
sum resb 1
After compilation I have the following error:
Command terminated by signal 11
Note:
I've tried
mov eax, [array+1*4]
and even
mov eax, [array*4] ; which is an error, obvious, but I can't understand why
Now to the question
I have some programming experience, but started learning assembly recently. This error, 11 seg fault, gives me a little. I would appreciate if you share your knowledge on this topic or recommend some good material to read.
Thanks!