What is the meaning of MOV (%r11,%r12,1), %edx?

对着背影说爱祢 提交于 2019-11-26 12:32:51

问题


What does this instruction do?

mov (%r11,%r12,1), %edx

回答1:


Look here. It says

In the AT&T Syntax, memory is referenced in the following way,

segment-override:signed-offset(base,index,scale)

Down on the page there are some examples. I find this the best:

GAS memory operand   NASM memory operand
------------------   -------------------
(%ecx,%ebx,2)    [ecx+ebx*2]

mov source, destination in AT&T syntax copies the value from source to destination. Also consider the size of edx. How many bytes (4) do you think mov will copy ?




回答2:


mov (%r11,%r12,1), %edx this instruction is use to calculate the address (indexed addressing mode).

  • %r11 is a base adress
  • %r12 is a index
  • and 1 is a multipler

It's work like this:

adres = base adres + index * multipler

base adres and multipler must be constants (base adress can be register), index must be register.



来源:https://stackoverflow.com/questions/2883850/what-is-the-meaning-of-mov-r11-r12-1-edx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!