X86-64 Reference Sheet (GNU Assembler Format) Instructions Addressing Modes Instruction Suffixes Condition Codes Integer Registe

X86-64 Reference Sheet (GNU Assembler Format) Instructions Addressing Modes Instruction Suffixes Condition Codes Integer Registe

x86-64 Reference Sheet (GNU assembler format) Instructions Arithmetic operations Instruction suffixes leaq Src, Dest Dest = address of Src Data movement b byte incq Dest Dest = Dest + 1 w word (2 bytes) movq Src, Dest Dest = Src decq Dest Dest = Dest − 1 l long (4 bytes) movsbq Src,Dest Dest (quad) = Src (byte), sign-extend addq Src, Dest Dest = Dest + Src q quad (8 bytes) movzbq Src,Dest Dest (quad) = Src (byte), zero-extend subq Src, Dest Dest = Dest − Src imulq Src, Dest Dest = Dest ∗ Src Conditional move xorq Src, Dest Dest = Dest ˆ Src Condition codes orq Src, Dest Dest = Dest | Src cmove Src, Dest Equal / zero CF Carry Flag andq Src, Dest Dest = Dest & Src cmovne Src, Dest Not equal / not zero ZF Zero Flag negq Dest Dest = − Dest cmovs Src, Dest Negative SF Sign Flag notq Dest Dest = ∼ Dest cmovns Src, Dest Nonnegative OF Overflow Flag salq k, Dest Dest = Dest ≪ k cmovg Src, Dest Greater (signed >) sarq k, Dest Dest = Dest ≫ k (arithmetic) cmovge Src, Dest Greater or equal (signed ≥) shrq k, Dest Dest = Dest ≫ k (logical) Integer registers cmovl Src, Dest Less (signed <) cmovle Src, Dest Less or equal (signed ≤) %rax Return value cmova Src, Dest Above (unsigned >) Addressing modes %rbx Callee saved cmovae Src, Dest Above or equal (unsigned ≥) %rcx 4th argument • cmovb Src, Dest Below (unsigned <) Immediate %rdx 3rd argument cmovbe Src, Dest Below or equal (unsigned ≤) $val Val %rsi 2nd argument val: constant integer value %rdi 1st argument Control transfer movq $7, %rax %rbp Callee saved %rsp Stack pointer cmpq Src2, Src1 Sets CCs Src1 Src2 • Normal %r8 5th argument testq Src2, Src1 Sets CCs Src1 & Src2 (R) Mem[Reg[R]] %r9 6th argument jmp label jump R: register R specifies memory address %r10 Scratch register je label jump equal movq (%rcx), %rax %r11 Scratch register jne label jump not equal • Displacement %r12 Callee saved js label jump negative D(R) Mem[Reg[R]+D] %r13 Callee saved jns label jump non-negative R: register specifies start of memory region %r14 Callee saved jg label jump greater (signed >) D: constant displacement D specifies offset %r15 Callee saved jge label jump greater or equal (signed ≥) movq 8(%rdi), %rdx jl label jump less (signed <) jle label jump less or equal (signed ≤) • Indexed ja label jump above (unsigned >) D(Rb,Ri,S) Mem[Reg[Rb]+S*Reg[Ri]+D] jb label jump below (unsigned <) D: constant displacement 1, 2, or 4 bytes pushq Src %rsp = %rsp 8, Mem[%rsp] = Src Rb: base register: any of 8 integer registers popq Dest Dest = Mem[%rsp], %rsp = %rsp + 8 Ri: index register: any, except %esp call label push address of next instruction, jmp label S: scale: 1, 2, 4, or 8 ret %rip = Mem[%rsp], %rsp = %rsp + 8 movq 0x100(%rcx,%rax,4), %rdx.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    1 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us