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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
09/21/11 08:50
Read: times


 
#183827 - Just don't kick in open doors
Responding to: ???'s previous message
Yes, C can make programs larger.

But what is normally debated here, is that a very large percentage of people write lousy assembler, in which case they often fail to match the C compiler on size or speed. The average assembler programmer is not an expert with many years of assembler programming experience.

Next thing often debated, is that it is very hard to produce a complex program in assembler and get even close to the development times you would get with C. And development times and time-to-market are often more critical parameters than size of program.

Next thing often debated, is that a C program is way easier to modify, in case of changed customer requirements. And many customers don't have the skills to know what they want, until they have tested a prototype - or until they start to get feedback from real users.

And next thing often debated, is that a C program is way easier to move to a different processor, in case of changed customer requirements, or in case a new processor is released that would give a significant cost reduction. Today, many products have life cycles of 1-3 years. So you want to be able to take one step back, make a completely new analysis of suitable hardware (cheap for mass production) and then lift as much as possible of existing know-how into new hardware. Again, and again, and again.

Next thing often debated, is that the size difference between a program written in C or assember (or the speed differene) is normally so small that it doesn't make a difference in processor cost. The cost difference is way higher between similarly spec:ed processors from two different product families, than the cost difference is between two chips in the same family - one with extra flash or RAM. And a move to a newer processor family often gives more speed + memory at a lower current consumption and purchase price.

In my case, the issue wasn't cost of Mega48 or Mega88, but that the Mega88 had the release date significantly delayed. And fitting everything into half the space wasn't trivial just because of assembler - lots of not too nice tricks was needed. Tricks that makes it way harder for someone else to modify the code. A compiler can detect common tail code between different functions, and automatically make use of this. Same programming methods in assembler makes it very hard to modify the code - a change of function A will also affect function B that assumes that the code after a specific label should still perform the same thing, with the same register allocations.

The 8051 architecture is notoriously C-unfriendly. A general-purpose 32-bit core on the other hand is way more all-round, making it much easier for a compiler to produce extremely tight code. The compiler can perform brute-force optimizations (similar to looking n steps forward in chess) in a way that is hard for a human. We can write "clean" assembler code, but get into troubles when we have 32 general-purpose registers, to keep track of what is - at every single time - stored in them. And when is it most optimal to dump one of the registers into RAM to instead pick up other data (or switch to use the register as an index or pointer).

List of 76 messages in thread
TopicAuthorDate
AT89LP51xD2 ... coming?            01/01/70 00:00      
   Sounds brilliant!            01/01/70 00:00      
      Was it AVR who made low-quantity available? Or just spin-off            01/01/70 00:00      
         Probably true            01/01/70 00:00      
            Hobbyists and students are really important            01/01/70 00:00      
               Also...            01/01/70 00:00      
         That wasn't the only thing ...            01/01/70 00:00      
            Assembler            01/01/70 00:00      
               'LP simulator            01/01/70 00:00      
                  Good            01/01/70 00:00      
                  No ... I doubt he means that ...            01/01/70 00:00      
               That may have been the case, but ...            01/01/70 00:00      
               While that may be the case ...            01/01/70 00:00      
                  Never used C - planned to but had to settle for half memsize            01/01/70 00:00      
                     See ... 'C' can make the memory requirement greater            01/01/70 00:00      
                        But it ain't *necessarily* so            01/01/70 00:00      
                           Yes, that's a valid basis for the choice of 'C'            01/01/70 00:00      
                        Just don't kick in open doors            01/01/70 00:00      
                           Again, you may be totally correct about that ...            01/01/70 00:00      
                        sure, and so friggin what if ...            01/01/70 00:00      
                           well ... that's not exactly what I did ...            01/01/70 00:00      
      On chip debug            01/01/70 00:00      
         Why unlikely?            01/01/70 00:00      
            That's true.            01/01/70 00:00      
            Yes, that's what I meant!            01/01/70 00:00      
         Missed the point!            01/01/70 00:00      
            Ah, sorry.            01/01/70 00:00      
   Single Clocker LP Chips From Atmel            01/01/70 00:00      
   Samples            01/01/70 00:00      
      Samples            01/01/70 00:00      
         Samples            01/01/70 00:00      
            Samples Not...            01/01/70 00:00      
               they are good at that            01/01/70 00:00      
               Atmel says...            01/01/70 00:00      
               Samples Yes!!            01/01/70 00:00      
                  Nothing here yet            01/01/70 00:00      
                     you are not in the US            01/01/70 00:00      
                        No excuse!            01/01/70 00:00      
                        Envelope?            01/01/70 00:00      
                      ... "coming" ...            01/01/70 00:00      
                        Yet another missed opportunity.            01/01/70 00:00      
                           Sorry thought this thread closed ...            01/01/70 00:00      
                              Now maybe you guys will see why I don't use 'em            01/01/70 00:00      
                              hard to tell, but...            01/01/70 00:00      
                                 They're thrashing about, but ...            01/01/70 00:00      
                                    why the sigh ...            01/01/70 00:00      
                                       Probably not ... but you never know ...            01/01/70 00:00      
                                    datasheets            01/01/70 00:00      
                                       I'm glad they're there ...            01/01/70 00:00      
                                          Sad, but true.            01/01/70 00:00      
                                             Too much "designers"            01/01/70 00:00      
                                                it's that old bugaboo ... appearance over substance ...            01/01/70 00:00      
                                                I'd say            01/01/70 00:00      
                           "The part will only be available in about 3 weeks"            01/01/70 00:00      
                              I've heard/read that comment from them before ...            01/01/70 00:00      
                                 Common with delays for new chips            01/01/70 00:00      
                                    Quite so!            01/01/70 00:00      
                                    I have to remind the public-at-risk            01/01/70 00:00      
                                       Again            01/01/70 00:00      
                                          There's a purpose ...            01/01/70 00:00      
                                 I agree with Per !!            01/01/70 00:00      
                                    Not so, but it probably applies to every one of ATMEL's            01/01/70 00:00      
                           samples            01/01/70 00:00      
                              I tested...            01/01/70 00:00      
                                 The AT89LP4052 works very well            01/01/70 00:00      
                                    Looks good, so far, eh?            01/01/70 00:00      
                                       A typical op            01/01/70 00:00      
                                          singleclockers            01/01/70 00:00      
                                          impressive            01/01/70 00:00      
                                             I will wait and see.            01/01/70 00:00      
                                                Transistors are cheap            01/01/70 00:00      
                                          I can't find that            01/01/70 00:00      
                                             Sorry. I thought it was unlikely.            01/01/70 00:00      
                                                copy/paste            01/01/70 00:00      
                                 thanks            01/01/70 00:00      
                              Have you received those samples, Andy?            01/01/70 00:00      

Back to Subject List