Intel x86 の命令

Menu Menu


Intel x86 の命令


addressing mode

    (address)     *address    address参照
    pointer       *pointer    pointer参照
    (%esp)        *(%esp)     indexed
    2(%esp)       *(%esp+w)   indexed + offset 
    %esp          %esp        register参照
    _234	  *(234)      変数アドレス
    $234	  234         数値


load store

    movl     load/store  from memory
	movl %eax,%edx              move long  (%eax to %edx)
	movb %eal,(%edx)            move byte
	movw %ax,(%edx)             move word
    lea    load effective address
	lea 5(%eax),%eax            %eax = 5 + %eax
    push/pop 
	pushl %eax
	popl %edx
    movsbl    sign extend (char to long)
	    movsbl 5(%eax),%eax
    movswl    sign extend (word to long)
	    movswl %si,%eax


compuation

    addl    add 
	   addl %edx,%ebx
    and     and
	   andl %eax,-4(%ebp)
    sal    arithmetic shift left
	    sall $4,%eax
    sar    arithmetic shift right
	    sarl $4,%eax
    cmp    compare
	    cmpl $0,-4(%ebp)
    neg    negative
	    negl %edx
    inc     increment
	    incl _ptr
    dec     decrement
	    decl _ptr
    XOR    exclusiv or
	    xorl %eax,%eax
    rol    rotate left
    ror    rotate right
    imull    multiply              
	    imull -4(%ebp),%eax        -4(%ebp) *= %eax
    idiv    divide    (signed)
	    xor %eax,%eax
	    idiv -4(%ebp)         %edx = %edx:%eax / -4(%ebp)
				  %eax = %edx:%eax % -4(%ebp)
    divl     divide    (unsigned)
	    ctld
	    divl -4(%ebp)         %edx = %eax / -4(%ebp)
				  %eax = %eax % -4(%ebp)
    or     or
	    orl %eax,-4(%ebp)
    subtract
	   subl $8,%esp


branch

    jmp    relative jump 
    call   subroutine call
    jxx    conditional branch
	    je, jne, 
	    jl, jle, jg, jge       signed
	    jb, jbe, ja, jae       unsigned
    ret    return from subroutine


miscellaneous

    leave    unlink opeation
    .align   alignment
    nop    no operation

Shinji KONO / Mon Oct 23 16:19:09 2000