Definition
x86-64
x86-64 (also called AMD64) is the 64-bit extension of the x86 instruction set, originally designed by AMD and adopted by Intel. It widens the general-purpose registers to 64 bits, adds the
R8–R15registers, and provides a 64-bit virtual address space while keeping backward compatibility with 32-bit x86 code. The slides’ binary-analysis crash course is written in x86-64 assembly.
General-Purpose Registers
Roles of the GPRs on x86-64
The eight original registers are extended to 64 bits (
Rprefix); their lower 32-bit (E), 16-bit (no prefix) and 8-bit (L/H) views are still addressable.
Register Role RAXaddition, multiplication, return values RBX/RDXvarious operations RCXloop counter RBPbase pointer — references arguments and local variables of the current [[Knowledge/Stack Frame RSPstack pointer — top of the stack RSI/RDIsource / destination for memory-transfer instructions (and argument passing, see below) R8–R15additional general-purpose registers The 32-bit equivalents are
EAX,EBX/EDX,ECX,EBP,ESP,ESI/EDI. See Calling Convention (x86-64) forRDI/RSI/RDX/RCX/R8/R9as argument-passing registers.
Special-Purpose Registers
The two non-general registers a binary analyst watches
RIP— the instruction pointer, holding the address of the next instruction to execute; jumps and calls overwrite it.RFLAGS— status flags that record the outcome of the previous computation and drive conditional branches. The three the lectures single out are:
ZF(zero flag) — set when the last result is zero;CF(carry flag) — set when the result is too large for the destination width;SF(sign flag) — set when the result is negative.A
cmp dst, srcsubtractssrcfromdst, updatesZF/CF/SFaccordingly, and the subsequent conditional jump (e.g.jle) reads those flags to decide whether to jump.
Syntaxes
Obs
x86-64 assembly admits two operand orders. Intel syntax writes
command dst, srcand is more readable; AT&T syntax writescommand src, dst(register names prefixed with%, immediates with$) and is the default of GNU tools likeobjdump. Disassemble in Intel flavour withobjdump -M intel -d.