Date: Sun, 1 Mar 1998 16:18:24 -0800 (PST) Message-Id: <199803020018.QAA20616@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: Tiziano , djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: Nasm+DJGPP Precedence: bulk At 09:33 3/1/1998 +0100, Tiziano wrote: >Hello! >I'm working on a simple 3D engine in DJGPP. Unfortunately C polyfillers >aren't so fast and I need to link asm code. I made a little FlatLine >routine with nasm but I have some problems. >If I compile without optimizations all works perfectly, if I compile >with -O2 -ffast-math -fexepensive-optimizations I have a segv error! >But why djggp mess with my code??? I suspect it is not that DJGPP messes with your code, but that you mess with its. :) Usually this happens when your ASM code doesn't preserve all the registers it should. You may get away with it without optimizations, since the compiler may not use those registers, but with optimization it tries harder and probably will use them. Your ASM must save these registers: ebx, esi, edi, ebp, ds, es. Nate Eldredge eldredge AT ap DOT net