When a program wants to invoke a method or a system API call, it !rst needs to prepare any arguments for the call. At the assembly level, there are speci!c rules about how to pass arguments to a method or API function.
The rules of the calling convention are articulated in an Application Binary Interface
1st argument - RDI 2nd argument - RSI 3rd argument - RDX 4th argument - RCX 5th argument - R8 6th argument - R9 7th argument - via the stack Return Value - RAX