TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Peter Hansen
from: Brian Converse
date: 1994-10-06 05:07:38
subject: Real-Time: C vs ASM

PH> coded in C, but by no means is this a general rule.  By the way, C
PH> compilers have long ago reached the point (at least on PCs) where they are
PH> so darn close to the speed of assembler that it makes little sense to say
PH> C is too slow for all but a very few cases.

I've yet to see any exciting optimization for the Pentium produced by
C  compiler Pentium "optimizers". the rules are simple enough, but the 
variations with real code are immense; often, the compiler cannot see 
whether a loop is used enough to be worth optimizing- if you're
unlucky  all sorts of single-pass and 2-pass code gets optimized for no
gain,  except in .OBJ size. It was not "long ago" that I was disgusted
with the "paranoia" code reloading segment registers in Microsoft C.
I've looked  for C compilers that, for example, use 386 instructions in
16-bit  segments. Nada. If it's 16-bit code, you get 286 stuff.

PH> LR> ... so why would anyone consider doing Real-Time work in anything but
PH> LR> assembler?  Anyone care to share their experise, insights, etc..
PH>   :
PH> Because assembler is slow (to code), bug-prone, and non-portable.  The
PH> only thing I ever code in assembler, if I have the choice, is the inner
PH> loop of my algorithm, and the parts of my real-time kernel that *must* be
PH> coded in assembler in any environment.

A common strategy. Yet, 80x86 assembler code can live on, and
actually  ends up running quite well, un-optimized for the dual
processors, even  on the Pentium.  At the rate hardware and process
systems are being  updated, an embedded controller may have a short
enough life to make a  particular assembler design (DOS/80x86)
worthwhile. And, it's job  security! My favorite cartoon: the
distraught 'suit' approaching the  bereaved gathered around a fresh
grave: "Did he ever say anything about  source code?"  Even with source
code, it may be cheaper to pay a new  programmer to redesign the
application.

OTOH, I'm impressed at the way OS/2 can handle mundane details of the
 user interface that every embedded application seems to need these
days. It's cheaper, and the platform more affordable, than custom VME
systems  using PSOS, for example, and more powerful and stable than
Windows.
--- Maximus/2 2.01wb

* Origin: Fernwood - your source for OS/2 files! (1:141/209)
SEEN-BY: 12/2442 54/54 620/243 624/50 632/348 640/820 690/660 711/409 410 413
SEEN-BY: 711/430 807 808 809 934 942 712/353 623 713/888 800/1
@PATH: 141/209 270/101 396/1 3615/50 229/2 12/2442 711/409 54/54 711/808 809
@PATH: 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.