From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ef33c33c4f98bde1 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Compiler for Z80/6510 Date: 1999/12/06 Message-ID: <82h3n5$cna$1@nntp4.atl.mindspring.net>#1/1 X-Deja-AN: 557380836 References: <383c6fed.458467@news.fiam.net> <81k67s$47l$1@nnrp1.deja.com> <383DC86C.19A6F176@australia.boeing.com> <1103_943587334@DZOG-CHEN> Organization: MindSpring Enterprises X-Server-Date: 6 Dec 1999 19:44:37 GMT Newsgroups: comp.lang.ada Date: 1999-12-06T19:44:37+00:00 List-Id: In article <1103_943587334@DZOG-CHEN>, falis@ma.aonix.com (Ed Falis) wrote: >My take on it, having been involved in Ada compilers for a long time, is >that an optimizing compiler can do well compared to the average >programmer, turned to assembly language. But, a good assembly >programmer for a given architecture can do better. This isn't rocket >science - human intelligence generally beats what we can simulate with >machines. It has been a long time since I have written assembler language programs, but I recall how we used to take advantage of all sorts of little tricks that an optimizer would not dare to assume. We could turn data into instructions and instructions into data, take advantage of knowledge concerning register contents at a specific point in the execution cycle and use that register in obscure ways. By knowing all of the instructions in a CISC set, one can do software contortions one would not expect of a compiler. If this makes you wonder about maintainability, you wonder correctly. In the long run, the maintainability of the compiler-generated code has significant advantages over the hand-tinkering we so loved to do in those primeval days of assembler only. There is a certain tendency to elitism here, as well. "Only whimps and sissies use compilers." Robert Dewar is fond of emphasizing "readability over writeability." It is not unusual for an assembler programmer to write a program that is highly efficient but totally unreadable, or contains instructions that seem to make no sense at all. "Why are there six successive NOP's in this code?" "Why does this instruction add Hex FFFF to this register?" Yes, a good assembler programmer can write more efficient code. It will even work until someone updates the instruction set or changes the timing characteristics of the processor. Richard Riehle http://www.adaworks.com