Mike Harrison whitewing.co.uk> writes: > No compiler will ever be as code-space and/or speed efficient as a good > assembler programmer - In > some cases, the lower efficiency can be due to fundamental limitations of the > language rather than > any particular compiler. I think that this is a myth. When one compares an assembly programmer with a C compiler one most often compares an average assembly programmer with ten crack assembler programmers who wrote the C compiler's code generator, which was then validated by hundreds or thousands of users. Every time someone uses assembler to do trivial tasks he reinvents the wheel, and since he might not be the best assembly programmer in the world, he may also do things suboptimally or induce bugs of his own. I also like assembly very much but at the right time and place. I did Z80, 8085, a little 80x86 (boot sectors etc), PIC and MCS51 and I know what I don't love and why. One begins to write 'reasonably' good assembly after studying several books about that particular processor's assembly. Until then, it's hacking at best. For non-RISC architectures the learning process is in the tens of years. Reinventing a (seemingly) clever 4-bit masking and adding operation (unbeknownst to the happy coder, for the 768,519th time in the last 20 years) is very satisfactory ego-wise but not very productive. And one can be sure that a good compiler will 'know' that trick, and ditto a good assembly book, and worse, not knowing this and boasting it in a resume or such may earn one bad marks. Some of my biggest AHA (aka Evrika) moments in programming came while analyzing compiler output listings. I think that anybody repeating the myth about 'compilers outputting less efficient code' without having read listings from a good compiler's output does not do himself justice. After all, compiler output *IS* machine code written using code generators made and optimized by expert assembly programmers. Of course size matters but as others have pointed out, size is not everything. Speaking of 20 years ago, I remember wrapping my mind around the tricks used by the Sinclair Spectrum's ROM authors (see the book about this) and being awed by the clever hardware (~12 ttl chips for TV output from a Z80 micro) of the ZX80 (not 81). Peter P. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist