P
Paul Burridge
W.I.N.D.O.W.S : Will Install Needless Data On Whole System.
If only it was as harmless as that.
W.I.N.D.O.W.S : Will Install Needless Data On Whole System.
Tanty said:Why is assembly preferred over C++, say, in time critical applications?
Thanx
Tanty
Paul Burridge said:Because C/C++ (or any such language even though C is the least
offender in this regard) is necessarily bloated for the sake of the
programmer's convenience. That convenience saves the programmer time
at the cost of processor-time. With Assembler, OTOH, you can taylor
your needs precisely to the intended application. User-friendly it
ain't; but it's certainly lean and mean.
But *real* programmers program in machine code...
Luhan said:Paul said:ISTR the heap memory handling ability of C is pretty crap though,
isn't it, Kev?
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit
patch
to an eight bit operating system originally coded for a
four bit
microprocessor and produced by a two bit company."
himself.
Ben Pope said:I don't see why you can't just be expected to write a destructor in much
the same way as you write a constructor.
Bill Sloman said:Nah. Real programmers program in whatever gets the job done right.
Joel said:For the guy with the AVRs and assembly vs. C: Why does the C compiler have
to be free? Can't it just be 'reasonably priced?' If the team using the
ARM CPU could afford you, you might be able to as well! I've founded that
mixed 'main code in C, time critical interrupts in assembly' does work quite
well. The only reason the interrupt routine might run a skosh more slowly
would be due to your having to save a few additional registers that the C
compiler considers its own that you would have avoided using had everything
been in assembly.
add this:W.I.N.D.O.W.S : Will Install Needless Data On Whole System.
If only it was as harmless as that.
--
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit patch
to an eight bit operating system originally coded for a four bit
microprocessor and produced by a two bit company."
Paul said:On Fri, 24 Oct 2003 22:26:49 +0100, "Kevin Aylward"
No. The amount of memory allocated in c++ is quite determistic.
ISTR the heap memory handling ability of C is pretty crap though,
isn't it, Kev?
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit
patch
to an eight bit operating system originally coded for a
four bit
microprocessor and produced by a two bit company."
Paul Burridge wrote:
On Fri, 24 Oct 2003 22:26:49 +0100, "Kevin Aylward"
No. The amount of memory allocated in c++ is quite determistic.
ISTR the heap memory handling ability of C is pretty crap though,
isn't it, Kev?
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit
patch
to an eight bit operating system originally coded for a
four bit
microprocessor and produced by a two bit company."
That doesn't care about its customers one bit.
Joel said:Because it requires extra programmer education and time? For many
applications that don't require particularly high performance, one can
argue it's better to but as much of the 'smarts' in the programming
language as possible so as to allow people to be productive as quickly as
possible.
I like languages such as C and C++ where you do all your own memory
allocations, I'm just suggesting that -- rubbish programmer or not --
sometimes you may be perfectly happy with a language-provided memory
manager. After all, plenty of C/C++ programmers end up writing their OWN
garbage collection routines for their own custom memory allocation
schemes! Again depending on the application, garbage collectors can be
perfectly legitimate memory managers.
add this:W.I.N.D.O.W.S : Will Install Needless Data On Whole System.
If only it was as harmless as that.
--
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit patch
to an eight bit operating system originally coded for a four bit
microprocessor and produced by a two bit company."
"but worth less than one bit."
Would anyone care to extend this into IEEE floating point to
reflect the collective IQ of the folks at Redmond? Can IEEE
floating point represent such a miniscule number?
Rich said:Luhan said:Paul said:On Fri, 24 Oct 2003 22:26:49 +0100, "Kevin Aylward"
No. The amount of memory allocated in c++ is quite determistic.
ISTR the heap memory handling ability of C is pretty crap though,
isn't it, Kev?
"Windows [n.], A thirty-two bit extension and GUI shell to a sixteen bit
patch
to an eight bit operating system originally coded for a
four bit
microprocessor and produced by a two bit company."
That doesn't care about its customers one bit.
Chuck said:A project I am on is studying this right now. C++ is not at issue in our
case but C is possible.
My chip has 3 AVRs in it and the other team has 1 AVR and an ARM in
their chip. C is already used for the ARM but the AVR software is all
assembler. My use of assembler for my 3 AVRs originated from my doing a
feasibility study for the 3 AVR architecture before joining the project
as a consultant. I could not find a free AVR C compiler at the time. At
the time (and still) I was looking at a 50kHz interrupt rate for all
three AVRs with AVR0 handling interrpts from 6 or more sources. C seemed
a stretch unless functions were never used and context switch was
watched closely.
The thinking now is that the other team can benefit from C because their
interrupt rate for their AVR is much lower than mine. All of the AVRs
have strange data memory maps but the good linkers can handle that. For
my part, AVR1 and AVR2 run substantially the same code which has not
changed in more than two years. There would seem to be no benefit given
the investment and the fact the code does not change.
My AVR0 is different. The code is complex (a mess) and hard to maintain.
I'm looking at repartitioning and using C for some blocks of code.
Linkers understand this so I have this as an attractive option. The fast
interrupt stuff might well stay in assembler but the slower interrupts
might work well in C. The other group is helping me with the evaluation.