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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/27/06 07:54
Modified:
  07/27/06 07:55

Read: times


 
Msg Score: +1
 +1 Informative
#121145 - to C or not to C
Responding to: ???'s previous message
Russell Bull said:
If you do your code in 'c' - moving from one micro to another is a lot less painless than rewriting reams of assembler code.


Sorry, Russell, for feeding the flames, but IMO this is the most common urban myth of embedded programmers.

I speak from experience - having ported successfully one quite big project twice, first changing the processor completely, second changing the major peripheral component, and I can reassure you that most of the work went into the "hardware dependent" part of it, which would have to be done in C or whatever language, too. Of course there was some work in the "rough translation", but that was mostly fun and went quickly and smoothly (I considered writing some sort of "compiler" but I estimated the gain in speed to be less than the "expense" to write it).

My view in this topic is, that
  • there is no point to port smaller projects, it is faster to rewrite it from scratch
  • the hardware dependent parts would need rewriting in C anyway; and the rest is mostly "mechanical translation" anyway
  • the programming style makes perhaps the biggest impact on porting "speed" (but nasty asm code is a bad thing generally)
  • porting from a feature-rich architecture (e.g. a 32-bitter) to a more restricted environment (e.g. a 8-bitter) would be really hard, but this is most probably language-independent

With the rest of your post, I completely agree.

Jan Waclawek


List of 26 messages in thread
TopicAuthorDate
How long we see 8051            01/01/70 00:00      
   unofficial history of 8051            01/01/70 00:00      
      History, or prediction?            01/01/70 00:00      
         It seems to gain, not lose            01/01/70 00:00      
   Does it matter?            01/01/70 00:00      
      Double negative?            01/01/70 00:00      
      to C or not to C            01/01/70 00:00      
         Defintely 'C'!            01/01/70 00:00      
            yeah, let's flame!            01/01/70 00:00      
          Defintely 'C'!            01/01/70 00:00      
            arguments            01/01/70 00:00      
               An example for 8051/AVR            01/01/70 00:00      
                  contra-example for 8051/AVR            01/01/70 00:00      
                  A slight mistake            01/01/70 00:00      
                     stdint.h            01/01/70 00:00      
               That's your trouble, then!            01/01/70 00:00      
                  Compiler independant            01/01/70 00:00      
                  C is not better            01/01/70 00:00      
                  bringing 2 togethert            01/01/70 00:00      
                  Opening pandora's box            01/01/70 00:00      
               Learning C            01/01/70 00:00      
                  for a beginner ...            01/01/70 00:00      
            are You sure?            01/01/70 00:00      
            Portability and scars            01/01/70 00:00      
   I'm an ASM Guru but            01/01/70 00:00      
      why discuss the rare exception tha same apply            01/01/70 00:00      

Back to Subject List