I have a question concerning parentheses in GAS. I have looked in SO and in quite a few number of other places, but I am still unclear on this:
What is the difference between?:
movl %edx, %eax
and
movl (%edx), %eax
From my understanding, parentheses dereference the address stored at the register.
| register | value | value at address | |
|---|---|---|---|
| 1 | %edx |
0x00 |
20 |
| 2 | %edx |
int 20 | whatever is located at 0x14 (int 20) ? |
I am understanding this as follows:
- # 1: an address is stored in the register
%edx == 0x00and(%edx) == 20
- # 2: a value is store in register
%edx == 20and(%edx) ==whatever is at0x14, which would probably segfault if attempted to access.
Can someone please elaborate on what the parentheses are doing and if I am seeing this correctly?