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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/25/06 01:51
Read: times


 
#113042 - My two cents
Responding to: ???'s previous message
Since I started the ball rolling with the 'portable' angle, I'd better act as referee!

Erik - We all know that there is no way of getting portable c as efficient as as couple of assembler instructions embedded in the code. However, there can be more efficient ways of doing parity in portable c and there's been healthy discussion of this. Parity is not only used for serial comms as Dan suggests. Recently I did some encryption code that used parity that I converted from PIC asm to portable 'c'. It still ran clock for clock faster in 'c' on the ARM vs the PIC in asm! And it didn't use anything 32bit - it was all 8 bit operations.

It is always worth investigating techniques that are portable when writing code and then weighing up the performance cost. On the '8051 the performance cost may be massive - so that can be a reasonable justification to go to assembler. Sometimes, if the project is small enough, then you can ignore the portability angle as to recode for another architecture etc is not a large task. If the code took man-months to write, that is a significant investment in time (money). Most of my projects are only a few thousand lines of code and I do not try to make the i/o portable - that is really just a waste of time unless you code is to run on many architectures from the outset. I do, however, try to localise the i/o specific code. Of course Erik, I know you realise this, but Dan had a cogent argument.

Thanks Dan for your contribution of other portable 'c' solutions. If I was writing for a 12 clocker 8051, then I'd most likely choose the assembler option, if it was an ARM at 60MHz, then I'd go for the portable 'c' solution if I wasn't squeezed for performance.





List of 30 messages in thread
TopicAuthorDate
odd parity problem            01/01/70 00:00      
   In Raisonance and Keil            01/01/70 00:00      
      OR            01/01/70 00:00      
         How about a portable solution?            01/01/70 00:00      
            calculating parity..            01/01/70 00:00      
            portable my ...            01/01/70 00:00      
         Or another portable solution?            01/01/70 00:00      
         And one more fast method            01/01/70 00:00      
            fast?            01/01/70 00:00      
               Yep            01/01/70 00:00      
                  Bag of Tricks            01/01/70 00:00      
                     bag of tricks..            01/01/70 00:00      
                        Good link. Thanks.            01/01/70 00:00      
                     Collecting            01/01/70 00:00      
                        ciontradictory request            01/01/70 00:00      
                           One confused puppy            01/01/70 00:00      
                              not confused            01/01/70 00:00      
                                 I/O and parity for '51 belongs in Chat            01/01/70 00:00      
                                    If memory parity were implemented, I sur            01/01/70 00:00      
                                       Memory -- expand your thinking a little            01/01/70 00:00      
                                          eeprom would be I/O            01/01/70 00:00      
                                             Memory plus software parity            01/01/70 00:00      
                                             8051 does calculate parity!            01/01/70 00:00      
                                                ALU versus I/O            01/01/70 00:00      
                  no such thought            01/01/70 00:00      
                     My two cents            01/01/70 00:00      
                        Choosing by architecture            01/01/70 00:00      
            thanks:) 18 Bytes each!            01/01/70 00:00      
               "Old" Europe            01/01/70 00:00      
   Simple method            01/01/70 00:00      

Back to Subject List