Date: Mon, 27 Oct 1997 17:12:02 -0800 (PST) Message-Id: <199710280112.RAA17320@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Sampo Niskanen , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: cwsdpmi and registers questions Precedence: bulk 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