1 2 3 4 5 6 7 8
.text .global __testandset __testandset: xorl %eax, %eax movl 0x4(%esp),%edx incl %eax xchgl %eax,(%edx) ret