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.
1
β sys_exit
: Exit the program4
β sys_write
: Write to a file descriptor (e.g. stdout)3
β sys_read
: Read from a file descriptor5
β sys_open
: Open a filesyscall
instruction instead of int 0x80
, and parameters go in different registers like rdi
, rsi
, rdx
.