I know GCC doesn't want certain registers to be modified, but which ones?
I know it wants return in eax.
Should ebx, ecx.. etc. be saved? I know es, ds... etc. have to be saved..... because GCC doesn't want you to change them.
What registers need to be saved?
Re:What registers need to be saved?
From http://my.execpc.com/~geezer/osd/libc/index.htm#call
check there for more info:
check there for more info:
GCC expects functions to preserve the callee-save registers:
EBX, EDI, ESI, EBP, DS, ES, SS
You need not save these registers:
EAX, ECX, EDX, FS, GS, EFLAGS, floating point registers
In some OSes, FS or GS may be used as a pointer to thread local storage (TLS), and must be saved if you modify it.