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.
I was hoping to find on-line manuals that I could print and read on the john. So far no luck. But what I really need is how to declare variables in C.
For example, I have a sample code that has the statement:
unsigned char
and
unsigned long
What do these mean and do they limit the declaration to integers. What do i declare if I want a floating point?
Also, someone told me I cant do floating point with a Keil Compiler because of licensing issues (I got my copy from Silicon Labs and have just registered it). I will eventually need to do trig functions. What do i have to get (buy) to complete my project?
Don't ignore the fact that the availability of C++ compilers is not so good for the 8051 chip - changing from a good C compiler to a bad C++ compiler can offset any tests.
But one thing with C++ is that virtual methods do not map well on the 8051.
Having established that certain standard features of 'C' don't map well onto the 8051, it should come as no surprise that certain of the additional, standard features of C++ also don't map well onto the 8051.
But, since the former didn't disqualify 'C' from being a valid tool for the 8051, I very much doubt that the latter necessarily disqualifies C++ as a valid tool for the 8051...
But it does very much depend upon the availability of a decent compiler...
Indeed.
I think the Ceibo offering translates C++ into C then compiles it with Keil, so perhaps all that is required is a decent translator, which may well be a rather easier thing to write than an optimising compiler. I don't know how much less 'efficient' the resulting object code is.
I think that the biggest problem here is that a user of a new tool (using C or C++) must spend time looking at the code, or at least have a very good knowledge how the language works internally together with a trust in the compiler vendors abilities.
It is so easy to look at a source code line that looks trivial, and assume that a trivial C or C++ source line must translate into similarly trivial assembler. But if the processor don't have any suitable instructions or addressing modes, major performance losses may be the result of the code.
Since C++ has operator overloading, virtual methods, ... it increases the probability that the compiler must work with pointers (cheap for most processors, but not a traditional 8051) and the amount of assembler code for a single C++ line may significantly increase.
In the end, the problem isn't with the tool but with the user. But sometimes it is better to warn people to not select a too sharp tool unless they are sharp enough to know how to use the tool.
Another thing is of course that most (all?) C++ compilers for 8051 only has a subset of C++. A fully compliant C++ RTL would require huge amounts of code and data, but the user would not really gain any advantages since a 8051 chip is not used for problems where all features are meaningful.