GCC Register Usage
I'm calling some assembly code from GCC
and I need to know which registers I'm supposed to preserve and which can be trashed.
I believe I can trash EAX (function return result), ECX and EDX, but I want to make sure. Thanks,
Randy Hyde
Quoted 5 lines · On Wed, 26 Jun 2002 [email protected] wrote:
I'm calling some assembly code from GCC
and I need to know which registers I'm supposed to preserve and which can be trashed.
I believe I can trash EAX (function return result), ECX and EDX, but I want to make sure.
Yes, you are right (for a common case).
I guess that you can trash everything in GCC inline asm statements (of course then you need to tell GCC to save registers it needs), though I'm not sure.
Signature · 2 lines
Regards, Konstantin