Memory indirect addressing movl - assembly

亡梦爱人 提交于 2019-12-07 16:26:50

问题


I'm trying to understand how exactly memory indirect addressing works in assembly language with AT&T syntax.

movl (%eax), %ebx

movl %eax, (%ebx)

Here is a similar question that explains about memory indirect addressing

This is what I've understood:

In the first case, you load the data pointed to by the register %eax and store it in %ebx.

In the second case, you store the data in the register %eax to the address space pointed to by the register %ebx. Am I correct?


回答1:


Basically the syntax is

movl source, destination

So movl (%eax), %ebx is indeed copy the value at address pointed to by %eax into %ebx. And movl %eax, (%ebx) is copy the value inside register %eax into the address pointed to by %ebx.

So indeed your understanding is correct.



来源:https://stackoverflow.com/questions/17020739/memory-indirect-addressing-movl-assembly

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