LOGBOOK

HELP

Quiz Entry - updated: 2026.07.06

What does it mean when you see mov $0x0, %eax (or xor %eax, %eax) right before a call to sscanf or printf?

It sets %al to 0 to declare "zero floating-point arguments passed in vector registers" — the System V ABI requires this before any variadic call like printf/scanf/sscanf.

mov  $0x4024de, %esi
mov  %rbx, %rdi
mov  $0x0, %eax
call <sscanf>

Why: The System V x86_64 ABI says: for variadic functions (printf, scanf, sscanf, etc.), %al must contain the number of floating-point arguments passed in XMM registers. If there are no floats, %eax = 0.

When you see it: Always before printf, scanf, sscanf, sprintf, and similar variadic functions.

When you DON'T see it: Before regular (non-variadic) function calls like strlen, strcmp, or user-defined functions — they don't need this.

Tip: If you see mov $0, %eax before a call, the target is likely a variadic function. This helps you identify printf/scanf even when the symbol name is stripped.

Go deeper:

From Quiz: REVE1 / Assembly Patterns & GDB | Updated: Jul 06, 2026