Contents    Page-10    Prev    Next    Page+10    Index   

Kinds of Move Addressing

There are several addressing styles that are used with move instructions:

Constants or immediate values are specified with a $. x86 allows even very large integer constants.


   movl   $0,%eax         #  0 -> %eax

Stack Variables have negative offsets relative to %rbp. The offset is the offset from the symbol table minus the stack frame size.


   movl   %eax,-32(%rbp)  #  %eax -> i
In this case, i has an offset of 16 and the stack frame size is 48, so net offset is (16 - 48) = -32.

Literals have offsets relative to %rip (current address).


   movsd   .LC5(%rip),%xmm0  #  0.0625 -> %xmm0

Record References have offsets relative to a register containing a pointer to the record.


   movl   %eax,32(%rcx)  #  ^. []