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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/22/08 14:35
Read: times


 
#149839 - Disagree!
Responding to: ???'s previous message
Erik Malund said:
the issue of 'portability' in small embedded is greatly overrated.

The likelyhood of something being transferred to another architecture is infinitessimally small.

No, I disagree - especially as things are increasingly needing to be interconnected.

When thing's are interconnected, you need a common "protocol" - and having to manually re-write it at each end is folly.

Should that happen, there will be so much that need to be changed that some attempt at portability in the original code will save just abhout 1% of the "porting time".

Not at all.
The lowest levels will be, as you say, 99% target-specific, but the upper protocols, algorithms etc should be easily portable.

Just look at printf...

That saved time will be far less than the hours upon hours spent on making the original code 'portable'.

If you design it to be portable, the overhead isn't that great and is certainly worth it.
It is certainly a lot less effort than trying to make something portable after the event, or trying to port something that could easily have been made portable in the first place.

"fix the compile errors" by observing and changing every U16 to UI while checking if the endianness matter (sounds cumbersome, but is not - I have done it)

It is cumbersome - and also error prone!
The "checking if the endianness matters" is entirely manual - so it's far too easy to just miss one.

Some of my vending machine stuff will compile and run for 8051, AVR, ARM, Borland PC, and Microsoft PC - just by using a suitable set of typedefs, defines, etc.

Apart from just having code that'll run on different platforms, it can often be very useful for testing...

List of 19 messages in thread
TopicAuthorDate
SDCC, copying integer in ASM            01/01/70 00:00      
   Shift-and-mask, or union            01/01/70 00:00      
      I used asm tag and the rr command but....            01/01/70 00:00      
         Your question            01/01/70 00:00      
            Portable unions            01/01/70 00:00      
               Less non-portable?            01/01/70 00:00      
                  Less non-portable            01/01/70 00:00      
                     portable, schmortable            01/01/70 00:00      
                        Disagree!            01/01/70 00:00      
                           how portable?            01/01/70 00:00      
                              emphasis            01/01/70 00:00      
                        Real world portable            01/01/70 00:00      
      using - does not give the same result            01/01/70 00:00      
         try this            01/01/70 00:00      
         You are exceeeding 2 byte signed integer limits            01/01/70 00:00      
            Fighting the tools            01/01/70 00:00      
   Thanks all.            01/01/70 00:00      
      Dangerous            01/01/70 00:00      
         Very important warning!            01/01/70 00:00      

Back to Subject List