Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: johnfine AT erols DOT com, djgpp AT delorie DOT com Date: Fri, 18 Sep 1998 15:55:26 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Optimizations In-reply-to: <36027FD2.329A@erols.com> Precedence: bulk "John S. Fine" wrote: > void foo(void) { > int index; > for (index=5; index>0; index--) > fun(); > } > > _foo: > pushl %ebx > movl $5,%ebx > .align 2,0x90 > L5: > call _fun > decl %ebx > testl %ebx,%ebx > jg L5 > popl %ebx > ret > > Notice the testl %ebx,%ebx. It isn't needed at all. > Help the idiot, use it: for (index=5; index; index--) ;-) SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013