Hi,
Like the title, I want to know which instruction in AT&T syntax as same as "offset" instruction in Intel syntax?
What is offset instruction in AT&T syntax?
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: What is offset instruction in AT&T syntax?
I think you are looking for the $ prefix... "offset" is not an instruction but a statement that tells the assembler you want the address (really the segment offset) of the following expression.
For example:
Becomes:
I am not sure if this covers all the cases. But t might just do.
For example:
Code: Select all
mov offset label, eax # Get the address of label into eax
Code: Select all
movl %eax, $label # Get the address of label into eax
Re: What is offset instruction in AT&T syntax?
Didn't you mistake the order? Isn't the exact opposite? Intel syntax is mov destination, source and AT&T is mov source, destination.kzinti wrote:I think you are looking for the $ prefix... "offset" is not an instruction but a statement that tells the assembler you want the address (really the segment offset) of the following expression.
For example:Becomes:Code: Select all
mov offset label, eax # Get the address of label into eax
I am not sure if this covers all the cases. But t might just do.Code: Select all
movl %eax, $label # Get the address of label into eax
Writing a bootloader in under 15 minutes: https://www.youtube.com/watch?v=0E0FKjvTA0M
-
- Member
- Posts: 102
- Joined: Wed Oct 20, 2021 6:00 pm
- Location: Paraguay
Re: What is offset instruction in AT&T syntax?
Oh, so it just basically the "$" prefix? Thank you for the answer!
Re: What is offset instruction in AT&T syntax?
Yep, sure did. Just inverse the operands in both of my examples.BigBuda wrote:Didn't you mistake the order? Isn't the exact opposite? Intel syntax is mov destination, source and AT&T is mov source, destination.