Open lhmouse opened 7 months ago
Also there should be an option to set the input syntax i.e. to pass -masm=intel
to GCC, so inline assembly can be in Intel syntax. Hence
__asm__ volatile (
"lock cmpxchg %0, %2"
: "+m"(value), "+a"(cmp) : "c"(swap)
// 0 1 2
);
will be accepted as lock cmpxchg qword ptr [rsp + 16], rcx
instead of some GNU nonsense such as
Error: operand size mismatch for `cmpxchg'
Indeed there are some issues with the Intel syntax e.g. one may want to use
SP
as the name of a function or static variable which would confuse the assembler, but for code that is to be read by humans, there is really no reason to prefer the awkward AT&T syntax.Other than official Intel and AMD documentation,
We also note this course is for Ubuntu but they don't use the GNU assembler.