'How can I fix this assembly code and make it work? [duplicate]

To Print decimal 5

section .text
  global _start

_start:
  mov edx, 1
  mov ecx, 5
  add ecx, 48
  mov ebx, 1
  mov eax, 4
  int 80h
ret

Commands I'm using for compiling on linux
nasm -f elf32 main.asm
ld -m elf_i386 -s -o main main.o

Error [1] 565 segmentation fault (core dumped) ./main



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source