Are there any 8051 C++ compilers ?

Ed Beroset wrote

This is much as you would expect. With no optimization, information is left unesturbed to ease debugging. Things like elimination of redundant constants and inlining is often (most often?) left to an optimizer.

I have had people complain about the performance of C++, just to find that they were measuring code running in debug mode (which often leaves the code 100 larger and 25 times slower on a PC).

Again: eliminating storage for simple consts is trivial, was done as early as 20 years ago, and is to the best of my knowledge done in all modern compilers.

-- Bjarne Stroustrup;

formatting link

Reply to
Bjarne Stroustrup
Loading thread data ...

Ed,

would you please try again with optimization level -O2?

You can get an assembly listing of the generated code by adding

-Wa,-ahlms=myfile.lst

to the compiler command line.

Tauno Voipio tauno voipio (at) iki fi

Reply to
Tauno Voipio

reality a

I do most of my programming on small embedded systems, and as such have very little call for malloc() or other dynamic memory routines. Personally, I'd prefer to have an explicit cast here too, but I can see why you might skip it - whatever makes the code more easily understood.

I would rather have an explicit cast than an implicit one (although I don't find pointer casts turning up very often in my code). I prefer to use the language rather than comments when possilbe (although obviously using comments as well, when necessary). I suppose I do skip the casts when using common functions such as memcpy(), however.

I agree here - if you have so many casts that you could becomes hard to read or understand, then you are definitely asking for trouble.

Reply to
David Brown

Us>Most of the people I end up helping with their systems were much

Then it is their perceptions that are faulty, as there is nothing preventing them from installing their old versions of WordPerfect, booting to DOS, and running their computer in the fashion they prefer.

It seems, in both of these cases, that the problem is not the OS, but that the users fail to learn enough about their systems to use those systems in the fashion they desire.

--
========================================================================
          Michael Kesti            |  "And like, one and one don't make
                                   |   two, one and one make one."
          mkesti@gv.net            |          - The Who, Bargain
Reply to
Michael R. Kesti

Nothing at all, but it is no longer a simple "type the name of the program and hit enter" user interface. It is a "take your hands off the keyboard, put your hand on the mouse, figure out which of 10-50 things on the desktop to click (or is it double-click?), figure out which of the 10-20 menu items you want to select, move the mouse to highlight the menu item, click on it (or do you double-click on it?), type the name of the program, hit enter, figure out how to make it full-screen" user interface. You have been using a WIMP interface so long that you no longer realize how unnatural it is.

Try that on a Windows NT or Windows 2000 system with the default NTFS filesystem and see how far you get. Assume that you are an ordinary user and try it on a Windows ME system running FAT32. Microsoft made deliberate design decisions to force Wordperfect users to switch to Microsoft Word.

No amount of learning about Windows NT will reveal a way for a default NT installation to boot into Real-mode, run MS-DOS, and run Wordperfect or Lotus 123.

Reply to
Guy Macon

Nope. I was including, at a minimum, Linux, Solaris, MacOS and Windows.

Certainly there is. Ever tried to boot to DOS in Windows NT, Windows ME, Windows 2000 or Windows XP?

The problem is that the availability of high-end resources (lots of RAM, fast CPU etc) has led to developers assuming the existence of these resources.

Previously, when this hardware was expensive, developers wrote software to be efficient in constrained systems. If you happened to own the hardware bells and whistles, then you could see extra functionality by loading an extension. If you wanted maximum speed or efficiency, you were still free NOT to load that extension, and operate the software in "fast" mode.

Reply to
Lewin A.R.W. Edwards

It should have but didn't occur to me that the unadorned plain command-line version would truly have zero optimization.

Ironically, I ran "strip" on the result as a matter of course, but neglected to specify any optimization! It seems that a useful corollary to "you don't pay for what you don't use" is "you don't get what you don't ask for."

Thanks also for the link to the ISO Performance Report. Based on testing of one C++ compiler for use on an embedded project, I had concluded that virtual function calls were "expensive" but now I see that it may be that the judgment was too hasty, and that performance varies more significantly by compiler than I had thought.

I only wish there were more modern compilers for embedded systems. On low end micros (like the 8051) and especially with less popular micros, there isn't much to choose from. Choices are often "buggy C compiler" vs. "slightly less buggy assembler."

For the less popular (often 8-bit or 4-bit) micros used in some embedded work, there are typically no C++ solutions available. Comeau is the only vendor I know of which currently supplies something like Cfront, but they stress that their solution is tailored to specific C compilers and is not for use as a generic C-compiler front end.

Is there much hope that this will improve significantly, say in the next decade or so, or is the current glacial, incremental approach the best we can expect? Is it that few people ask for C++ compilers for embedded work, or that they're that much difficult to create?

Ed

Reply to
Ed Beroset

the

opening

program

While it is easy to get a Start/Run box without wading through menus ( + R), you can't start most windows programs by just typing their names - you've got to know the full path name in all its absurdities, because MS has failed to produce an os and file system that can support symbolic links and can work with large numbers of files in a directory.

preventing

Why on earth would you want to "boot to DOS" to run a DOS program? What's wrong with using a command prompt window, that has worked for every DOS program (except some games) from Win95 through to XP?

Reply to
David Brown

absurdities,

Well, a simple c:\bat in your path and a batch file for every program you want to start will do the trick....

I stil use a few old DOS programs that open files by using FCB's instead of filehandles. FCB's disappeared from NT4 and higher. So you would *have to* run either DOS or something "as low as" win 95 or ME.

Meindert

Reply to
Meindert Sprang

typing

Mine's called "d:\utils", and has about 400 batch files and small utility programs... and then there's d:\cygwin\bin... (I'm a command-line junky). Bat files are a workaround - ineligant, but they work.

What's

of

Have you had a lookat DOSBox

formatting link
? It's mainly aimed at running games, but it might work for your old programs, and will apparently run fine under pretty much any windows fork (as well as *nix). I haven't tried it myself, though.

Reply to
David Brown

I

Thanks for that pointer David. I'll check it out.

Meindert

Reply to
Meindert Sprang

... snip ...

That problem can be completely resolved by simply installing 4dos or 4nt (jpsoft.com). Then the final step is to create an alias to run the program, either directly or via a 'start' command.

--
"Churchill and Bush can both be considered wartime leaders, just
 as Secretariat and Mr Ed were both horses." -     James Rhodes.
"A man who is right every time is not likely to do very much."
  -                            Francis Crick, co-discover of DNA
Reply to
CBFalconer

You are saying that the users have to learn all about a new OS to continue using the applications with which they are familiar and satisfied?

Reply to
Everett M. Greene

Not "all about a new OS", but yes, if they are going to run a new OS then they are going to have to learn enough about it to use it in the way they wish. This seems not too much to ask, but, if it is, perhaps they ought to run an OS with which they are familiar and satisfied.

--
========================================================================
          Michael Kesti            |  "And like, one and one don't make
                                   |   two, one and one make one."
          mkesti@gv.net            |          - The Who, Bargain
Reply to
Michael R. Kesti

Unfortunately it is the spec from middle management that some time in the past did a small project with a '51. They have added some buzzwords (including C++) to the spec to show that they have kept up with the times. The fact that they are showing their complete and utter ignorance is beside the point. I am/was looking fro diplomatic arguments to use in changing the spec. It looks as if I have managed to get rid of the C++ part - now I only need to get rid of the '51 part.

Regards Anton Erasmus

Reply to
Anton Erasmus

The problem - specifically with MS series of OSses is that the average user just starts to get a grip on things when they drop support for the "old" stuff and provide a new version which basically just stuffs around with the user interface. The average joe are forced to upgrade, because if even a simple question is asked about using the previous version, the answer invariably is " Upgrade to the latest greatest -we do not support THAT version any more". If car manufacturers started to move controls around willy nilly in every new model car, I am sure that people will protest. In the computer world, many people are too unsure of themselves to really protest -- When/If they do they are often made to feel foolish and stupid.

Regards Anton Erasmus

Reply to
Anton Erasmus

Because we represent a tiny fraction of the total potential market, and we won't pay MORE for a cut-down version of the OS.

Reply to
Lewin A.R.W. Edwards

Then one can only conclude that the feature set you seek isn't all that important to you.

--
========================================================================
          Michael Kesti            |  "And like, one and one don't make
                                   |   two, one and one make one."
          mkesti@gv.net            |          - The Who, Bargain
Reply to
Michael R. Kesti

Microsoft has, but Linux makes it very easy indeed to remove the features you don't want.

Reply to
Guy Macon

/Most/ computer users wouldn't know what they desire if it jumped up and bit them.

Somehow, Billy Gates has convinced people that instead of "640 Kbytes of memory is more than anyone will ever need", they now need 64 Mbytes minimum just to load his OS. If they would like to do some useful work, they had better have even more hardware resources.

Those who know what features they seek know they don't need bloatware to get it.

Reply to
Everett M. Greene

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.