x86: register operation as memory content and memory address?

后端 未结 1 2039
执念已碎
执念已碎 2021-01-17 05:44

register ---> memory address --> memory content

memory address --> memory content

is the above model correct??

and, if it is can you suggest if i am

相关标签:
1条回答
  • 2021-01-17 06:23

    movl %eax, %ebx --> moves the content of register %eax into register %ebx. It is irrelevant what %eax contains.

    movl (%eax),%ebx --> moves the content of the memory address contained in %eax into register %ebx

    movl value, %eax --> moves content of memory address value into register %eax.

    movl %eax, val --> moves content of register %eax to memory address val

    movl $val, %eax --> moves the constant $val into the register %eax

    movl %eax, $val --> impossible. You cannot move something into a constant value.

    movl (%eax), val --> impossible. You must use a register as intermediate:

    movl (%eax),%eax
    movl %eax,val    ; or use another intermediate register than %eax                    
    

    mov (%eax), $val --> impossible. You cannot move something into a constant value.

    mov $val, (%eax) --> move constant value $val into memory address contained in %eax.

    0 讨论(0)
提交回复
热议问题