I was trying to play a bit in assembly.
My understanding is that sys calls are made through an interrupt generated by the syscall instruction.
However after compiling a simple program on my computer using clang -S:
int main() {
write(0, "HI", 2);
return 0;
}
The relevant assembly generated is:
movl $0, -4(%rbp)
leaq L_.str(%rip), %rsi
movl $2, %edx
movb $0, %al
callq _write
Why is that ?
Is there a way to see the actually sys call being performed on OS X ?