LOGBOOK

HELP

Quiz Entry - updated: 2026.07.06

After cmp A, B in AT&T syntax, how do you read the conditional jump?

Read it as "jump if B (condition) A" — cmp A, B computes B - A, so the condition is about the second operand relative to the first.

cmp A,B computes B minus A and sets flags; the following jump is read as B relative to A, with a warning against reading it as A relative to B

* cmp A, B computes B - A, so the conditional jump reads as B relative to A (not A relative to B). *

cmp $5, %eax
jl  label

Reads as: "jump if %eax < 5"

cmp %ebx, %eax
jge label

Reads as: "jump if %eax >= %ebx"

Why? cmp A, B computes B - A and sets flags. The conditional jump then tests those flags as if asking about B relative to A.

Common mistake: Reading it as "A < B" because A comes first — but AT&T source-destination order means A is subtracted FROM B.

Go deeper:

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