Date: Wed, 9 Sep 1998 11:20:46 +0300 (IDT) From: Eli Zaretskii To: Endlisnis cc: djgpp AT delorie DOT com Subject: Re: MAJOR slowdowns in translating TP7 gfx code to DJGPP2: Suplement In-Reply-To: <35F5A6C5.5551B40F@unb.ca> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 8 Sep 1998, Endlisnis wrote: > I looked at the asm code generated for the div function, it > doesn't look too optimal, it might be faster to use "/" and "%" > instead. As far as I can see, that's exactly what `div' does, except that it also handles the case of a negative divisor (in the usual case, where it's positive, you only pay two comparisons, which isn't a lot). > The div function is more than 40 instructions What matters is not the total number of instructions, but the number of instructions that are actually executed in the usual case, see above. > or does it check for div by zero or something? See the sources (IMHO, anybody who is serious about DJGPP programming should have djlsr201.zip on their machine).