I am very new in nasm assembly, so I apologize if this was a really noob question. This is what I've got so far.
%include    'functions.asm'
section .data
    ip_prompt   db  "Enter a decimal number to be converted to binary: ", 0h
    binary_res  db  32 dup('0')
section .bss
    dec_input resb 32    
section .text
    global _start
    
_start:
    mov     eax, ip_prompt
    call    str_print
    mov     eax, SYS_READ
    mov     ebx, STDIN
    mov     ecx, dec_input
    mov     edx, 32
    int     80h
    mov     eax, dec_input
    call    str_print
    mov ecx, 0
    mov eax, dec_input
    mov ebx, 2
    xor edx, edx
convert_to_bin:
    div     ebx
    mov     [binary_res + ecx], edx
    inc     ecx
    cmp     eax, 0
    jne     convert_to_bin
    mov     eax, binary_res
    call    str_print_endl
    call    quit
I am trying to implement the continuous division method by dividing the dec_input into 2 until it reaches 0. But after running the program, it outputs Segmentation fault (core dumped).
