Why is RCX not used for passing parameters to system calls, being replaced with R10? [duplicate]
X86-64 system calls use syscall instruction. This instruction saves return address to rcx, and after that it loads rip from IA32_LSTAR MSR. I.e. rcx is immediately destroyed by syscall. This is the reason why rcx had to be replaced for system call ABI. This same syscall instruction also saves rflags into r11, and then masks … Read more