C is NOT a portable assembler (was: want to know)
nevin.j.liber
nevin1 at cbnewsc.ATT.COM
Thu Aug 24 10:43:58 AEST 1989
In article <1496 at l.cc.purdue.edu> cik at l.cc.purdue.edu (Herman Rubin) writes:
>No, the question is not a JOKE. It is a stupidity in UNIX which causes the
>problem. I have used other systems in which the main program could have
>any name whatever, and even in which the entry need not be to a main program,
>while a main program is present. I have even used it.
It has finally dawned on me on what Herman Rubin thinks C is. Now I
know why stuff like entry points and hardware registers and NAND
gates bother him. He must have heard the phrase "C is kind of a
portable assembler". This phrase is a misnomer!
C is closer to (and I really hate to call it this because I KNOW that
someone is going to misinterpret me) a portable assembly language than
a portable assembler. C defines a virtual machine which maps fairly
efficiently onto a wide variety of current computer architectures.
What this allows one to do is write code which will work unaltered on a
lot of different machines. This is why the implementations of other
languages (such as C++, Eiffel(?), etc.) compile (and I mean
compile, not translate. Compilers output syntactically correct code, be
it assembler, p-code, or C; translators may rely on the post-processor
to catch the syntactical errors) to C; it is portable.
Now let's look at what Herman wants. He wants to be able to
hand-optimize his code; to know which variables go into which
registers, what branch instructions are used, etc. In other words, he
wants an extra-fancy macro assembler! C is not this, and it will never
be this! He complains that he can't do everything in C that he can in
assembler. Of course not! C was never intended to replace an
assembler (except perhaps on a PDP-11 :-))! Please stop complaining
that C doesn't fit your want of a super-duper macro assembler; C isn't
one, it is a *language*.
--
NEVIN ":-)" LIBER AT&T Bell Laboratories nevin1 at ihlpb.ATT.COM (312) 979-4751
More information about the Comp.lang.c
mailing list