Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!caen!uwm.edu!linac!att!bellcore!uunet!overload!dillon From: dillon@overload.Berkeley.CA.US (Matthew Dillon) Newsgroups: comp.sys.amiga.programmer Subject: Re: Lemmings - a tutorial Part IV Message-ID: Date: 30 Mar 91 19:07:49 GMT References: <23787@well.sf.ca.us> Organization: Not an Organization Lines: 71 In article mykes@amiga0.SF-Bay.ORG (Mike Schwartz) writes: >In article mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) writes: >>In article mykes@sega0.SF-Bay.ORG (Mike Schwartz) writes: ... >> >>Yeah - the men realize that choosing the right tool for the job makes >>them more productive; the boys don't realize that doing everything in >>assembler does little more than make them overworked. >> > >'C' is hardly ever the right tool for games. I use it a lot when I use >my Amiga as a workstation, but if it weren't for the fact that I have >a 68030, the performance would suck. > >Jim Goodnow used 'C' to write his assembler (as), and HiSoft used >Assembler language. AS is > 50K and is a slow pig. Devpac is 27K on >disk and is blindingly fast. Which is the right tool? I don't care >how hard YOU think it is for HiSoft to maintain the source to their >assembler, but ME the consumer cares how it performs. Genim2 is the >ONLY assembler on the market that performs as it is documented, and it >has NO bugs. I have bought every other assembler and they all are >deficient and larger. This is amusing, because you are making a blanket statement about two similar products written in different languages. You are assuming that C, generally, is a sludgepile compared to assembly. Well, I am happy to say that you are dead wrong! The primary difference in speed between Manx AS and DevPak is NOT that one is written in C and the other is written in assembly, but in the ALGORITHMS used... things like symbol table searching and such. It is true that hand optimized assembly is faster, but not that much faster than a program written in C by the same programmer (the keyword). Obviously, a C program will only run as well as the programmer programs, same goes with assembly. DAS, the assembler in DICE, while it doesn't implement a few things like INCLUDE and macros, is on-par with DevPak and only half as fast as ArgAsm in all other comparisons (ArgAsm is blindingly fast not only because it written in assembly, but also written by an expert programmer). So here you have DAS in C and DevPak in assembly and, lo!, they are the same speed! And, gee, it took me a week to write DAS, I wonder how long it took them to write DevPak? ArgAsm took several months to write in assembly, I believe. That's a good return on my investment, I think. Even so, much of the difference between ArgAsm and DAS can be attributed to the fact that ArgAsm is a one-pass assembler while DAS is a two-pass. So in terms of efficiency ArgAsm, written by an expert programmer, is only a little more efficient than DAS. If I were to rewrite DAS as a one-pass assembler it would be comparable. Now you get to the nitty gritty... how can ArgAsm get away with being a one pass assembler? It makes various assumptions, requires XREF's to occur before usage, and makes additional assumptions for branches. DAS is a two pass assembler because it does major branch size optimizations and Bcc-to-Bra optimizations more suited to the assembly output of the compiler. Actually, internally, DICE is a 5 pass assembler but only two of the passes do major computation. So, don't make blanket statements about C and assembly please. -Matt -- Matthew Dillon dillon@Overload.Berkeley.CA.US 891 Regal Rd. uunet.uu.net!overload!dillon Berkeley, Ca. 94708 USA