Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!lll-winken!iggy.GW.Vitalink.COM!widener!dsinc!bagate!cbmvax!cbmehq!cbmger!amiux!holgerl From: holgerl@amiux.UUCP (Holger Lubitz) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: Date: 5 Apr 91 16:23:31 GMT References: <1991Mar31.003933.1483@mintaka.lcs.mit.edu> <1991Apr1.020748.26863@mintaka.lcs.mit.edu> Organization: Teuwag Lines: 44 In article mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes: >Why do 'C' programmers ask me whether I use: > MULU #17,d0 >instead of: > move.l d0,d1 > lsl.l #4,d0 > add.l d1,d0 >when it is basic programming normally done by assembler language >programmers (one of the oldest tricks in the book)? Since I happen to be the one who did, I will try to explain: In my experience, the average assembler programmer does NOT know those tricks. I have seen some demo sources from some guys who claimed themselves to be some of the coolest demo programmers, and guess what I saw ? Tons of absolute adressing. Tons of unneeded instructions (like TST after an instruction that already sets the zero-bit correctly) or wrong ordered instructions (like TST-ing a return value before copying it elsewhere instead of first copying it and leaving out the TST). And there is always one who never heard of TST and uses CMP.L #0,... instead (don't laugh, there has been an assembler introduction in a german magazine that suggested just that ! And the guy who wrote it didn't even believe that TST was shorter and faster when I first called him... Took me several calls to convince him.) So I would rather have some C programs by those programmers (the optimizing compilers prevent most of this), because they would actually run FASTER. Just because the average C compiler nowadays usually knows how to produce good assembly code (I am not talking about 1985's compilers, of course), while the *average* assembler programmer usually doesn't. If you think that YOU know perfectly well how to program in assembler, just go ahead and do it. But don't tell anybody that assembler is always faster. They might believe it. Best regards, Holger -- Holger Lubitz | holgerl@amiux.uucp Kl. Drakenburger Str. 24 | holgerl@amiux.han.de D-W-3070 Nienburg | cbmvax.commodore.com!cbmehq!cbmger!amiux!holgerl