??? 07/20/09 18:43 Read: times |
#167628 - C++ Responding to: ???'s previous message |
Per Westermark said:
Andy Neil said:
I get a similar impression with many of the anti-C++ tirades from 'C' programmers... I absolutely love C++. So do I -- and I like ObjectiveC even more. But it is my personal belief that you will gain very little from using it on a 8051, because of the pointer problems with the processor core. A very big improvement would have been to use objects, but the 8051 do not like the "this" pointer. Many other processors would actually gain from the use of objects. They can - without cost - add a small offset to the "this" pointer for all read and write accesses instead of having to bother with full addressing if the data had been stored as separate variables. Yes, exactly! There's a pervasive myth that C++ program binaries are larger than C binaries. Part of that is the result of people writing C++ for GUI platforms which use library functions to do most of the work. On a 32-bit embeddeded platform where the developer controls the environment, C++ could be an advantage. I suppose that if I had time I could port a MicroBlaze project to C++ and encapsulate my hardware-access stuff in classes. That would go a long way towards mitigating the need for file-scope globals and dealing with multiple instances (I have five SPI masters in one design). -a |