Where can I find documentation on registers whose assembly should be preserved when calling function C?
Dr Agner Fogs Optimization Guides provide an excellent side-by-side list of all common systems and compiler conventions (ABIs) for 32 and 64 bits. They also contain a lot of other useful information, you can get them here: http://www.agner.org/optimize/
What you want is your binary C C. Google application interface for “C ABI” and your architecture, and you will find it. For example, here is one for sparc and here is the corresponding bit for AVR.
ABI (Application Binary Interface). ? .
: Google ABI x86_64 linux, 64- Linux-.
ABI x86_64 linux
, CDECL. , , "", , - %eax, %ecx %edx. .
%eax
%ecx
%edx
, , . , .
:
Using Win32 Conventions
Intel x86 Feature Call Conventions - Build View
Hope this helps.
This is largely characteristic of architecture. Look at the Wikipedia explanation for beginners.
http://en.wikipedia.org/wiki/Calling_convention