LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

How are Linux system calls invoked on IA32 (32-bit), and how does it differ from x86_64?

Put the syscall number in %eax and arguments in %ebx, %ecx, %edx, %esi, %edi, %ebp, then execute the software interrupt int $0x80 (not syscall).

The legacy 32-bit mechanism traps into the kernel with a software interrupt rather than a dedicated instruction:

Register Purpose
%eax System-call number
%ebx Argument 1
%ecx Argument 2
%edx Argument 3
%esi Argument 4
%edi Argument 5
%ebp Argument 6
mov  $1, %eax     # syscall 1 = exit (on IA32!)
mov  $0, %ebx     # status = 0
int  $0x80        # trap into the kernel

Differences from x86_64 — three things change at once:

  1. Instruction: int $0x80 instead of syscall.
  2. Registers: a completely different set (%ebx,%ecx,…).
  3. Numbers: the syscall numbers themselves differ — e.g. exit is 1 on IA32 but 60 on x86_64; write is 4 on IA32 but 1 on x86_64.

Gotcha: %esp can't carry an argument — the CPU overwrites it when switching to kernel mode.

Go deeper:

From Quiz: REVE1 / Translation of C to Assembly | Updated: Jul 14, 2026