Mail Archives: djgpp/1997/10/27/20:14:26
At 04:51 10/21/1997 GMT, Sampo Niskanen wrote:
[Charles already answered the other question]
>When I optimize fully (-O3), and use external asm-routines (made with
>nasm) what registers do I have to restore? Without optimization it doesn't
>need any registers restored, but when I started to use -O3 it gave trouble
>with atleast ESI and EDI. I'm not sure about the other registers and would
>like to be.
If I'm not mistaken, you have to preserve ESI, EDI, EBX, EBP, DS, and ES all
the time. You also have to preserve ESP, so pop off everything you push.
(Don't pop your args!) I think with lower optimization levels you just got
lucky and the function didn't happen to be using those registers.
Nate Eldredge
eldredge AT ap DOT net
- Raw text -