What does the bracket in `movl (%eax), %eax` mean?
%eax is register EAX; (%eax) is the memory location whose address is contained in the register EAX; 8(%eax) is the memory location whose address is the value of EAX plus 8.
%eax is register EAX; (%eax) is the memory location whose address is contained in the register EAX; 8(%eax) is the memory location whose address is the value of EAX plus 8.
RIP addressing is always relative to RIP (64bit Instruction Pointer) register. So it can be use for global variables only. The 0 offset is equal to address of the following instruction after the RIP-addressed instruction. For example: mov al,[rip+2] al=53 jmp short next (length=2 bytes) db 53 next: mov bl,[rip-7] (length=6 bytes) bl=53 You wouldn’t … Read more
I believe that you want to load the address of your string into %rsi; your code attempts to load a quadword from that address rather than the address itself. You want: lea msg(%rip), %rsi if I’m not mistaken. I don’t have a linux box to test on, however.
There aren’t really official names for most forms of x86 addressing modes. They all have the form [base + index*scale + disp8/disp32] (or a subset of any 1 or 2 components of that), except for 64-bit RIP-relative addressing. See Referencing the contents of a memory location. (x86 addressing modes) for a breakdown of what you … Read more
On the 8086 (and 16-bit addressing in x86), only addressing modes of the form [bp|bx] + [si|di] + disp0/8/16 are available. Listing them all: [bx] [bx + foo] [foo] [bp + foo] [si] [si + foo] [di] [di + foo] [bx + si] [bx + si + foo] [bx + di] [bx + di + … Read more
Answer recommended by Intel