Movl Indirect Addressing Memory - Build

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

movl (%eax), %ebx movl %eax, (%ebx) 

Here is a similar question that explains indirect addressing

Here is what I understood:

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

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

+3
source share
1 answer

In principle, the syntax

 movl source, destination 

So movl (%eax), %ebx does copy the value at the address provided by% eax to% ebx. And movl %eax, (%ebx) copies the value inside the% eax register to the address pointed to by% ebx.

So your understanding is correct.

+4
source

Source: https://habr.com/ru/post/1488076/


All Articles