Hi, I've searched for information on segmentation faults, but haven't found much applicable to my situation, so I was wondering if there was something obvious in my hello world here that is causing a segmentation fault that you could see.
This program asks for the user's name, then says: "hello", then the user's name. Pretty fancy, here it is:
Segment .text
global _start
_start:
mov eax, 4
mov ebx, 1
mov ecx, prompt1
mov edx, len1
int 0x80 ;print: "plz enter your name"
mov eax, 3
mov ebx, 0
mov ecx, name
mov edx, 200
int 0x80 ;get input,
mov esi, eax
mov eax, 4
mov ebx, 1
mov ecx, prompt2
mov edx, len2
int 0x80
mov ecx, name
mov edx, esi
int 0x80
Segment .data
prompt1 db "plz Enter your name", 10
len1 equ $-prompt1 ;length of the string: $-prompt1
prompt2 db "Hello "
len2 equ $-prompt2
Segment .bss
name resb 200
What it ends up doing is just asking for your name, then once you give it, it says: hello segmentation fault.