Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!news.funet.fi!assari.tut.fi!assari.tut.fi!n67786 From: n67786@lehtori.tut.fi (Nieminen Tero) Newsgroups: comp.sys.mac.programmer Subject: Re: Pascal deficiency? Message-ID: Date: 18 Dec 90 16:47:55 GMT References: <13650001@hpspdra.HP.COM> <1990Dec18.042748.6765@d.cs.okstate.edu> Sender: news@assari.tut.fi (USENET News System) Organization: Tampere Univ. of Technology, Finland. Lines: 30 In-Reply-To: minich@d.cs.okstate.edu's message of 18 Dec 90 04:27:48 GMT I also tried {x += 1;} and it produced identical asm to BETA, which is OK. What I don't understand is what the heck is going on around what I marked "ick." Surely such a minute optimisation as not reading back what you just wrote is not too difficult to code. (Of course, I don't write compilers, either. :-) However, I think the ideal would be to replace ALPHA's +0004 MOVEQ #$01,D0 | tmp = 1; +0006 MOVE.W D0,-$0002(A6) | x = tmp; <== ick +000A MOVE.W -$0002(A6),D0 | tmp = x; <== +000E ADDQ.W #$1,D0 | tmp = tmp + 1; +0010 MOVE.W D0,-$0002(A6) | x = tmp; with MOVEQ.W #$1,-$0002(A6) | x = 1; ADDQ.W #$1,-$0002(A6) | x = x + 1; and be done with it. OK. Would someone out there with a Motorola 68000/020/030 (or most notably 040 manual) check which one uses the leas clock sycles. Don't be that easily fooled by the number of lines of code produced if speed is what you are after. Operations on registers (ie. the move-to-reg add-to-reg) tend to be a lot faster in Motorola processors (especially 040) than operations on memory locations. Just my 0.02 worth. -- Tero Nieminen Tampere University of Technology n67786@cc.tut.fi Tampere, Finland, Europe