The common calling conventions for IA-32 say:
• Callee-save registers
%ebx, %esi, %edi, %ebp, %esp
Callee must not change these. (Or restore the caller\'s v
A guess:
If the caller saves all registers it will still need after a function call, it wastes time when the called function doesn't modify all those registers.
If the callee saves all registers it changes, it wastes time when the caller didn't need the values in those registers again.
When some registers are saved by caller and some by callee, the compiler (or assembly programmer) can choose which kind to use depending on if the value is needed after the next function call.