IA32 Instructions Addressing Modes Registers Condition Codes IA32 Reference Sheet (GNU Assembler Format) Instruction Suffixes

IA32 Instructions Addressing Modes Registers Condition Codes IA32 Reference Sheet (GNU Assembler Format) Instruction Suffixes

IA32 Reference Sheet (GNU assembler format) IA32 instructions Addressing modes movl Src, Dest Dest = Src • Immediate $val Val Src,Dest Dest (long) = Src (byte), sign extend movsbl val: constant integer value Src, Dest Dest = Dest + Src addl movl $17, %eax Src, Dest Dest = Dest – Src subl • Normal imull Src, Dest Dest = Dest * Src (R) Mem[Reg[R]] R: register R specifies memory address sall Src, Dest Dest = Dest << Src movl (%ecx), %eax sarl Src, Dest Dest = Dest >> Src arithmetic shift shrl Src, Dest Dest = Dest >> Src logical shift • Displacement Src, Dest Dest = Dest ^ Src D(R) Mem[Reg[R]+D] xorl R: register specifies start of memory region andl Src, Dest Dest = Dest & Src D: constant displacement D specifies offset orl Src, Dest Dest = Dest | Src movl 8(%ebp), %edx Dest = Dest + 1 incl Dest • Indexed decl Dest Dest = Dest - 1 D(Rb,Ri,S) Mem[Reg[Rb]+S*Reg[Ri]+D] D: constant displacement 1, 2, or 4 bytes Dest Dest = – Dest negl Rb: base register: any of 8 integer registers Dest Dest = ~ Dest notl Ri: index register: any, except %esp S: scale: 1, 2, 4, or 8 leal Src, Dest Dest = address of Src movl 0x100(%ecx,%eax,4), %edx cmpl Src2, Src1 Sets CCs Src1 – Src2 Src2, Src1 Sets CCs Src1 & Src2 testl Instruction suffixes jmp label jump b byte je label jump equal w word (2 bytes) jump not equal jne label l long (4 bytes) js label jump negative jns label jump non-negative Condition codes jump greater (signed) jg label CF Carry Flag jge label jump greater or equal (signed) ZF Zero Flag jump less (signed) SF Sign Flag jl label OF Overflow Flag jle label jump less or equal (signed) jump above (unsigned) ja label Registers jb label jump below (unsigned) push Src %esp = %esp – 4, %eax Mem[%esp] = Src %ecx pop Dest Dest = Mem[%esp], %edx %esp = %esp + 4 call label push address of next instruction, %ebx jmp label %esi ret %eip = Mem[%esp], %edi %esp = %esp + 4 %esp %ebp.

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