C for embedded controllers (was Re: Timed mechanical fuel injection )
Bruce Bowling
bowling at cebaf.gov
Wed Nov 22 19:19:29 GMT 1995
~
~ --------
~
~ In message <199511220503.XAA06506 at net.dris.com> , you write:
~
~ | going to market it. It continually is improving, and I agree with Larry,
~ | use machine language. Although something like C is easier to program,
~ | machine code is more direct to the point, requires less memory, and the
~ | hardware often can be made simpler. My fuel injection system uses one HC11,
~
~ ok, I don't want to start a debate nor a flame war on this, but some of
~ the advantages of *not* using assembly should also be discussed
~ (again?).
~
~ | C is easier to program
~
~ Absolutely. From conception to the final debugged program, assembly
~ language takes me at least 4 times longer to develope for *small*
~ programs (YMMV, the ratio is worse for RISC). Once you get used to
~ using a high level debugger, like gdb, its very hard to revert back
~ (and unnecessary) to a low level monitor. RTOS, math libraries, and
~ other software tools are much more available for C (gnu bin-utilities,
~ gcc, gdb, newlib, glibc, RTEMS,... are examples currently ported to
~ efi332. Programming efi332 is *no* different than programming under any
~ unix system. I've often ran the same program on an SGI workstation,
~ linux PC, and efi332 *without* any modifications.).
~
~ | machine code is more direct to the point
~
~ I don't understand this comment... do not the two programs (C vs
~ assembly) do the same thing?
~
~ | requires less memory
~
~ True, but maybe only by 10-20% with a good optimizing C compiler (gcc
~ for the 68k is a good example. Optimization is cpu dependent.). With
~ larger programs it is conceivable the C will be smaller since it
~ generally promotes better structure. The archive has examples
~ comparing assembly to C for the 68000 (efi68k).
~
~ | hardware often can be made simpler
~
~ This is nonsense. Remember, assembly can easily be placed in-line
~ within any C code. Functionally there can be no difference. Execution
~ maybe slightly slower for C in general, but time critical routines can
~ be written in assembly.
~
~
~ John S Gwynne
~ Gwynne.1 at osu.edu
What John said.
- Bruce
--
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------
Bruce A. Bowling
Staff Scientist - Instrumentation and Controls
The Continuous Electron Beam Accelerator Facility
12000 Jefferson Ave - Newport News, VA 23602
(804) 249-7240
bowling at cebaf.gov
http://devserve.cebaf.gov/~bowling
-----------------------------------------------------
<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-----------------------------------------------------
More information about the Diy_efi
mailing list