Date: Tue, 28 Oct 1997 19:16:37 -0800 (PST) Message-Id: <199710290316.TAA12804@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Sampo Niskanen From: Nate Eldredge Subject: Re: cwsdpmi and registers questions Cc: djgpp AT delorie DOT com Precedence: bulk At 06:08 10/28/1997 +0200, Sampo Niskanen wrote: > >> [Charles already answered the other question] > >What? Did I miss something in the newsgroup. I haven't atleast gotten any >mail on it. I don't seem to be able to get the old news-messages back, so >if you know how to pass commandline options to cwsdpmi (-s-), please mail >me how. I think he changed the subject to "cwsdpmi noswap". I'll mail you what he said. Basically, the approved method is to use cwsparm to disable swapping. > >> (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. > >I don't think so, because I have used a LOT of functions in asm that use >the registers, and they have worked fine. Also, I'd recall reading with >info, that without any optimization options, gcc will not use any >registers to store variables. Yeah, maybe it won't allocate variables there, but it still needs registers to be able to do things, like compile complicated expressions. You might have got off okay if you didn't have very complex ones. Anyway, I looked in the GCC sources. It expects EAX, ECX, EDX and the floating-point registers to be clobbered by a function call, and everything else to be preserved. And this is not affected by optimization. Nate Eldredge eldredge AT ap DOT net