title: Does the assembly function call cause all registers to be pushed onto the stack?
body: <p>I am interested in what happens when executing the <code>call</code> instruction of the assembly code Visual C++ is compiled to.
  What I think happens is that the call instruction itself pushes all context onto the stack (register content, PC, ...) and updates the PC. But then again, I wonder whether all context is pushed or not. In many cases, not all registers are used within the function called. Do the compiler detect this and only push the context that is modified by the function, or is pushing all context implemented so cheaply at the hardware level that it is always done?</p>