🐧 Linux Syscalls & Interrupts

In Linux Assembly programming, a syscall (system call) is your gateway to ask the kernel to do stuff for you β€” like reading files, writing output, or exiting the program. This is done using software interrupts, typically int 0x80 on 32-bit x86 systems.

When you invoke int 0x80, you’re triggering an interrupt that hands control to the Linux kernel. The kernel then looks at the value in the eax register to decide which syscall you want to run. Parameters go in other registers like ebx, ecx, and edx. Once the syscall is done, control returns back to your program.

βš™οΈ Common Syscall Numbers (x86)

πŸ“š Example: Print "Hello, World!"

πŸ–₯️ Simulated Output

Hello, World!
πŸ’‘ Pro Tip: In 64-bit Linux, syscalls use the syscall instruction instead of int 0x80, and parameters go in different registers like rdi, rsi, rdx.