Search notes:

Assember (x86/x64): addressing modes

The addressing mode specifies how an address of a memory location is calculated.
x86/x64 has the following addressing mode forms and its sub-variants:
section:[ base-register  +  index-register * N  +  displacement ]   ; N ∈ {1,2,4,8} / displacement a 32-bit constant. section is optional
        [ RIP                                   +  displacement ]   ; 64-bit only? Aka RIP-relative mode?
Any register can be a base-register, any register except rsp/esp can be an index-register.
The referenced registers have to be the same size (unless an alternate address size is used???).

RIP-Relative

RIP-relative mode supports modern operating systems by providing a flat address space with a single code, data and stack space.
This mode is the default addressing mode in 64-bit programs.

AT&T syntax vs Intel syntax

The Intel indirect syntax reference of the form section:[base + index*scale + disp] is translated into the AT&T syntax section:disp(base, index, scale). (AT&T requires section to be prefixed with a %).
Intel AT&T
[esi] (%esi)
[ebp-8] -8(%ebp)
[ebp*4 + 0100] 0x100(, %ebx,4)
[edx+ebx*4 + 8] 0x8(%edx,%ebx,4)`
See also this link.

See also

With the lea instruction, it's possible to assign the value of an address rather than the value of the location that that address points at.

Index