Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/09/08 19:27
Read: times


 
#160800 - There is no question about it!
Responding to: ???'s previous message
Per,

Can you come up with even one example of a compiler, the output from which can't be further reduced in size or increased in performance, or both by careful coding in ASM? I suppose it's possible, but I don't see how. I realize that there's more to the tradeoff than just code size and speed, but I don't see any way in which an automatic compiler can produce code that's smaller and/or faster than an expert programmer writing in ASM, no matter how expert the HLL programmer is. HLL's allow the coder to produce "something" that runs within a day or two, while ASM might take a bit longer for a beginner, but I don't think any compiler expert, and there are several who routinely visit this site, will claim his compiler can do better than an ASM expert as far as size and speed are concerned.

That's why I say, it is always possible to take the ASM output from a compiler and "fix" it by hand in ASM. For small code, perhaps for the purpose of avoiding having to buy the next-larger MCU, i.e. the one with the next-larger size of program store, I'm persuaded that ASM is the only avenue that can be used to "make it fit." The compiler makes it far too easy to make it large, or to make it slow. For small code, such as that which will fit in 128KB of code space, or less, ASM is, from where I sit, the tool of choice.

The tendency to use HLL's, using the excuse of "better maintainability" as a justification, makes it far too easy to write a 'C' program that compiles and links to 25 Kb when 1K bytes might have done the job. Letting people start out at the beginning with 'C' or Pascal, when there's really no idea yet what the eventual code size might be, which is common practice, leads to such situations. The common questions about "how to <insert task here>" usually comes with a 'C' program for an exercise that would only require a few dozen lines of ASM. The coder's inability to understand what's going on is usually traceable to his failure to learn the details of his MCU.

RE

List of 50 messages in thread
TopicAuthorDate
Which programming language is the best?            01/01/70 00:00      
   depends on compiler            01/01/70 00:00      
   Who is "we"            01/01/70 00:00      
   Creativity            01/01/70 00:00      
      Responding to Andy Neil "Who is we?"            01/01/70 00:00      
         apples and oranges            01/01/70 00:00      
            Re: apples and oranges            01/01/70 00:00      
               Correct            01/01/70 00:00      
               Calling conv more depending on target than language            01/01/70 00:00      
                  Re: Calling conv...            01/01/70 00:00      
         not the rule            01/01/70 00:00      
   Do you think Spanish is better than Mandarin?            01/01/70 00:00      
      Concise?            01/01/70 00:00      
         fair question            01/01/70 00:00      
            Maybe            01/01/70 00:00      
               There is no question about it!            01/01/70 00:00      
                  Does it work ?            01/01/70 00:00      
                     Unless it impacts cost ...            01/01/70 00:00      
                  Bottom line            01/01/70 00:00      
                     ... and that is the problem with many products ...            01/01/70 00:00      
                        Not true            01/01/70 00:00      
                           low-volume/high-volume tradeoffs            01/01/70 00:00      
                        Bottom line price is more than just consumed kB code space            01/01/70 00:00      
            Oh no, not that old chestnut            01/01/70 00:00      
               Assembler and processor size            01/01/70 00:00      
                  Is that relevant to this environment?            01/01/70 00:00      
                     Human brain            01/01/70 00:00      
               You will have trouble convincing me ...            01/01/70 00:00      
                  I agree with you there!            01/01/70 00:00      
      Re: Spanish better than...            01/01/70 00:00      
         That's the point!            01/01/70 00:00      
         not so            01/01/70 00:00      
   In a war which is the best weapon ?            01/01/70 00:00      
      the language in which programmer feels comfortable            01/01/70 00:00      
         Comfort is not the issue!            01/01/70 00:00      
            true, but            01/01/70 00:00      
         It's about the right tool(s) for the job            01/01/70 00:00      
   My two cents            01/01/70 00:00      
      If it fits ...            01/01/70 00:00      
         that is (ir)relevant            01/01/70 00:00      
            What is small?            01/01/70 00:00      
               Would that be appropriate on 805x?            01/01/70 00:00      
                  more on big/small series            01/01/70 00:00      
                     Does this approach fit 805x and other small MCU?            01/01/70 00:00      
                        Already have full Linux solutions too            01/01/70 00:00      
   Yes..C and asm is the best            01/01/70 00:00      
   I prefer KEIL U2V , C programming language.            01/01/70 00:00      
      Magic with Kel C?            01/01/70 00:00      
      Makes no sense!            01/01/70 00:00      
   Pascal is not dead            01/01/70 00:00      

Back to Subject List