Общие соглашения о вызовах для IA-32 гласят:
• Callee-save registers
%ebx, %esi, %edi, %ebp, %esp
Callee must not change these. (Or restore the caller's values before returning.)
• Caller-save registers
%eax, %edx, %ecx, condition flags
Caller saves these if it wants to preserve them. Callee can freely clobber.
Почему существует это странное соглашение? Почему бы не сохранить все регистры перед вызовом другой функции? Или пусть вызываемый сохраняет и восстанавливает все с помощью pusha
/popa
?