Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!dsinc!bagate!cbmvax!jesup From: jesup@cbmvax.commodore.com (Randell Jesup) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part V (last) Message-ID: <20243@cbmvax.commodore.com> Date: 2 Apr 91 04:16:26 GMT References: <1991Apr1.020748.26863@mintaka.lcs.mit.edu> <1991Apr2.002631.22799@mintaka.lcs.mit.edu> Reply-To: jesup@cbmvax.commodore.com (Randell Jesup) Organization: Commodore, West Chester, PA Lines: 37 In article <1991Apr2.002631.22799@mintaka.lcs.mit.edu> rjc@geech.gnu.ai.mit.edu (Ray Cromwell) writes: >>>The following was compiled with GCC -O -fstrength-reduce -fomit-frame-register >>>I don't have SAS C on the Amiga, but I'm sure it produces simular results. >>> >>>/* test.c */ >>> >>>char buf[20]; >>>main() >>>{ >>> char *d=(char *)&buf; >>> const char *s="This is a test\n"; >>> while(*s) { *d++=*s++; } >>>} SAS C: (5.10a) | 0000 48E7 0030 MOVEM.L A2-A3,-(A7) | 0004 47EC 0000-02.2 LEA 02.00000000(A4),A3 | 0008 45EC 0000-01.2 LEA 01.00000000(A4),A2 | 000C 6002 BRA.B 0010 | 000E 16DA MOVE.B (A2)+,(A3)+ | 0010 4A12 TST.B (A2) | 0012 66FA BNE.B 000E | 0014 4CDF 0C00 MOVEM.L (A7)+,A2-A3 | 0018 4E75 RTS It does use a2/a3 instead of a0/a1. However it beats the GNU version slightly by jumping to the test instead having two copies of it. I suspect the next major release of SAS will have this fixed (I talk to them often, and have suggested this improvement to them before). -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.commodore.com BIX: rjesup Disclaimer: Nothing I say is in anything other than my personal opinion. Thus spake the Master Ninjei: "To program a million-line operating system is easy, to change a man's temperament is more difficult." (From "The Zen of Programming") ;-)