1. In intel format, most of them use upper-case letters (both in lower case) and lower-case letters in at&t format.
2. In at&t format, Register names must be prefixed with "%", which is not required in intel.
3. The original operation of the command is different from that of the destination operand. For example, if the eax value is passed into the EBX command, in Intel, the target is in the front, and the original operand is in the back (mov EBX, eax), while at&t is in the opposite way (mov % eax, EBX ). One of their ideas is: EBX = eax, and the other is: % eax-> % EBX.
4. The operands of the access command are different in size: at&t is B (8 bits), w (16 bits), and L (32 bits ). The intel format is to add byte PTR (word PTR, dword ptr) before the memory operand ). For example, to direct the 8-Bit Memory Unit pointed to by foo to the Register Al:MoV Al, byte PTR Foo (Intel format), movb Foo, % Al (at&t format)
5. In at&t format, "$" must be added before the direct operand, but not in Intel format. For example:Push 4 (Intel format), pushl $4 (at&t format ).
6. In at&t format, the absolute professional or call command jump/call operations must be added"*".
7. Differences between the operation codes for remote transfer and invocation commands: at&t format(Lcall $ section, $ offset, ljmp $ section, $ offset), In Intel format(Call far section: Offset, JMP far section: Offset).
8. Indirect addressing format:
Section: [base + Index * scale + disp] (Intel format)
Section: disp (base, index, scale) (at&t format)
This addressing method is often used to access a field in a specific element in an array of data structures. Base is the actual address of the array, scale is the size of each array element, and index is the subscript, if the array element is a data structure, DISP is the displacement of a specific field.
For example, if index is eax, scale is 4, and disp is FOO:
[Foo + eax * 4] (Intel format), Foo (, % eax, 4) (at&t format ).Note that when at&t only contains base, the comma can be omitted.
Read the full text
Category:View comments in Linux