official gnu as reference for x86 instructions - specifically cmpxchg

LIU Hao lh_mouse@126.com
Wed May 15 11:57:16 GMT 2024


在 2024-05-15 19:39, Segher Boessenkool 写道:
> The source code of GAS (well, libopcodes) is the ultimate reference to
> what instruction syntax is accepted by GAS.  See
> https://sourceware.org/git/?p=binutils-gdb.git;a=blob&f=opcodes/i386-opc.tbl
> and files around that.

Having read that page, I don't see any syntax construction about CMPXCHG. Given the fact that 
CMPXCHG looks much similar to MOV, it's reasonable to assume the same convention as MOV; and it is 
the case.

I don't recommend reading the source code. Both dialects have not been well defined, and both 
contain a lot of ad-hoc solutions to non-issues, e.g. why is there the `OFFSET` keyword in Intel 
syntax, and why is `jmp *%rax` not `jmp (%rax)` in AT&T syntax. Compiler output is really the only 
thing worth reading.


-- 
Best regards,
LIU Hao

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20240515/26b4190a/attachment.sig>


More information about the Gcc-help mailing list