Why does my assembly network server application cause a segmentation fault?

I'm working on a network server application in assembly language so I can understand low level networking concepts.

So I've implemented a socket server using assembly language system calls, but I'm encountering a segmentation fault during execution.

I have complied the binary on an Intel Core i7 12700K processor running Ubuntu 22.04 and the NASM assembler .
I wander what is causing the segmentation fault ?

$ nasm -f elf32 socket.asm ; ld -m elf_i386 -o socket socket.o

$ ./socket 

Segmentation fault (core dumped)
file0.jpg
Was this page helpful?