We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I was browsing through older posts that deal with the painful issue of portability (http://www.keil.com/forum/docs/thread8109.asp). I was (and still am) a big advocate of programming as much as possible conforming to the C standard, and having a layered structure that allowed "plugging-in" other hardware. But I have come to change my mind recently. I am reading the "ARM system developer's guide" (excellent book by the way. I'm reading it because I want to port some C167 code to an ARM9 environment) in which chapter 5 discusses writing efficient C code for an ARM. The point is, and it is fairly demonstrated, that even common, innocent looking C code can either be efficient of very inefficient on an ARM depending on specific choices made, let alone another processor used! So, if we are talking about squeezing every clock cycle out of a microcontroller - I do not believe that portability without ultimately littering the code is possible!
Here is a dictionary definitions of "portability":
portability operating system, programming
The ease with which a piece of software (or file format) can be "ported", i.e. made to run on a new platform and/or compile with a new compiler. The most important factor is the language in which the software is written and the most portable language is almost certainly C (though see Vaxocentrism for counterexamples). This is true in the sense that C compilers are available for most systems and are often the first compiler provided for a new system. This has led several compiler writers to compile other languages to C code in order to benefit from its portability (as well as the quality of compilers available for it). The least portable type of language is obviously assembly code since it is specific to one particular (family of) processor(s). It may be possible to translate mechanically from one assembly code (or even machine code) into another but this is not really portability. At the other end of the scale would come interpreted or semi-compiled languages such as LISP or Java which rely on the availability of a portable interpreter or virtual machine written in a lower level language (often C for the reasons outlined above). The act or result of porting a program is called a "port". E.g. "I've nearly finished the Pentium port of my big bang simulation." Portability is also an attribute of file formats and depends on their adherence to standards (e.g. ISO 8859) or the availability of the relevant "viewing" software for different platforms (e.g. PDF).
The ease with which a piece of software (or file format) can be "ported" that, to me, reads "everything is portable, some more than other". If 'portability" is the ease, then a bit of ease is still the ease.
And then it contradicts "It may be possible to translate mechanically from one assembly code (or even machine code) into another but this is not really portability".
I would conclude that either nothing is portable or everything is portable. Whether you think it is portable depend on your definition of "the ease"
Erik
Yes, I know it's useless, but it makes me feel special; and it breaks the monotony of my otherwise boring day!
well, you ported us to the three-figure realm!
Thinking that you can prove black==white is nothing to be proud of.
You only think that because you have failed to understand what goes before it.
What on earth is going on inside your head?
then a bit of [GREY] ease is still the ease.
Is this word salad day?
Did you have a point or do you just like posting for the sake of it?
Did you have a point yes, I do and that a smoked sardine can not see it is no concern of mine