[sdiy] Organisation of tasks in synth's main uP

Tom Wiltshire tom at electricdruid.net
Tue Nov 23 13:46:57 CET 2010


On 11/23/10 08:46 , Carsten Toensmann wrote:
> I don't know the real overhead using C or any other languages but it
> might be better to use assembler instead of C.


Don't worry, Carsten, I've seriously considered it, even for a job of this size. However, I think ultimately C is the better choice because it offers you more in the way of structure (without having to put it there yourself) and makes the conditional logic lot easier to read and debug.

On 23 Nov 2010, at 12:34, Thomas Strathmann wrote:
> Nothing stops anyone from just writing a simple program loop in just about any language. Overhead is not primarily a language issue: If you compare C and assembler (assuming reasonable C compilers) you'll notice that you can write the same algorithm in any number of moronic ways in both languages. If you know what your target architecture does best you'll be well off regardless of clinging to assembler or C instead of C++.

I quite agree that you can write a simple program loop or hideous code in any language. One advantage of coming to this from assembly is that I do have a clear understanding of what the target architecture looks like since I've been dealing with nothing else for the last goodwhile. I hope that this will enable me (in time) to write C that compiles down to something neat and fast. For now I just have to get up to speed with my C.

As to C++, I learned it at Uni but haven't done any since, and anyway, are there compilers for C++ and dsPIC?

Thanks,
Tom




More information about the Synth-diy mailing list