On Wed, May 15, 2024 at 07:57:16PM +0800, LIU Hao wrote: > 在 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. Line 923. If you want to understand what things there mean, well, I said "and files around that", right! > 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. I only pointed to it because it is the final word on what GAS does and does not accept as instruction syntax. Of course it is not a good place to learn the assembler language, nor should you learn the instruction set here. Others in the thread already pointed out where to go for that. And yes, I agree x86 assembler syntax is weird, incomprehensible sometimes, and certainly not self-consistent, coherent, or logical :-) Segher