
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
x86-64 Reference Sheet (GNU assembler format) instructions, addressing modes and integer registrar
Typology: Cheat Sheet
1 / 1
This page cannot be seen from the preview
Don't miss anything!

movq Src, Dest Dest = Src movsbq Src,Dest Dest (quad) = Src (byte), sign-extend movzbq Src,Dest Dest (quad) = Src (byte), zero-extend
cmove Src, Dest Equal / zero cmovne Src, Dest Not equal / not zero cmovs Src, Dest Negative cmovns Src, Dest Nonnegative cmovg Src, Dest Greater (signed > ) cmovge Src, Dest Greater or equal (signed ≥) cmovl Src, Dest Less (signed < ) cmovle Src, Dest Less or equal (signed ≤) cmova Src, Dest Above (unsigned > ) cmovae Src, Dest Above or equal (unsigned ≥) cmovb Src, Dest Below (unsigned < ) cmovbe Src, Dest Below or equal (unsigned ≤)
cmpq Src2, Src1 Sets CCs Src1 Src testq Src2, Src1 Sets CCs Src1 & Src jmp label jump je label jump equal jne label jump not equal js label jump negative jns label jump non-negative jg label jump greater (signed > ) jge label jump greater or equal (signed ≥) jl label jump less (signed < ) jle label jump less or equal (signed ≤) ja label jump above (unsigned > ) jb label jump below (unsigned < ) pushq Src %rsp = %rsp 8, Mem[%rsp] = Src popq Dest Dest = Mem[%rsp], %rsp = %rsp + 8 call label push address of next instruction, jmp label ret %rip = Mem[%rsp], %rsp = %rsp + 8
leaq Src, Dest Dest = address of Src incq Dest Dest = Dest + 1 decq Dest Dest = Dest − 1 addq Src, Dest Dest = Dest + Src subq Src, Dest Dest = Dest − Src imulq Src, Dest Dest = Dest ∗ Src xorq Src, Dest Dest = Dest ˆ Src orq Src, Dest Dest = Dest | Src andq Src, Dest Dest = Dest & Src negq Dest Dest = − Dest notq Dest Dest = ∼ Dest salq k , Dest Dest = Dest ≪ k sarq k , Dest Dest = Dest ≫ k (arithmetic) shrq k , Dest Dest = Dest ≫ k (logical)
b byte w word (2 bytes) l long (4 bytes) q quad (8 bytes)
CF Carry Flag ZF Zero Flag SF Sign Flag OF Overflow Flag
%rax Return value %rbx Callee saved %rcx 4th argument %rdx 3rd argument %rsi 2nd argument %rdi 1st argument %rbp Callee saved %rsp Stack pointer %r8 5th argument %r9 6th argument %r10 Scratch register %r11 Scratch register %r12 Callee saved %r13 Callee saved %r14 Callee saved %r15 Callee saved