Typically, OS executes in supervisor mode, which allows it to do things like manipulate the disk directly. To switch from normal user mode to supervisor mode, most machines provide a system call instruction. This instruction causes an exception to take place. The hardware switches from user mode to supervisor mode and invokes the exception handler inside the operating system. Let's do an example - the Open system call.
System calls typically start out with a normal subroutine call.
In this case, when the process wants to open a file, it just calls the Open routine in a system library someplace. Inside the exception handler the OS looks at register 2 to figure out what system call it should perform. The Open system call also takes a parameter - the address of the character string giving the name of the file to open. By convention, the compiler puts this parameter into register 4 when it generates the code that calls the Open routine in the library. So, the OS looks in that register to find the address of the name of the file to open.