Re: Hey, what is all this 'off topic' posting?



On Mon, 05 Sep 2005 12:40:58 -0400, keith wrote:

> On Sun, 04 Sep 2005 20:17:37 +0200, Frank Bemelman wrote:
>
>> [quoted text muted]
>
> Macros are far more than (even sort of) subroutines. They can do
> conditional processing too. A few years back (when I was doign such
> things) I had a set of x86 assmebler macros that would do PL/I-like
> branch constructs (IF/THEN/ELSE, SELECT/WHEN in both forms, LOOP, UNTIL,
> etc.). Assembler macros are *much* more than (sort of) subroutines. If
> that's all you're using macros for, I can see why you don't much like ASM.

It's the duckling syndrome. We always love whatever we bonded to as a
child.

I like C because it's what I 'grew up' with. I've done lots of asm coding,
but it is always painful when I have to hack out the loop control
structures yet again using compare and branch instructions (or write the
macros using some arcane assembler to do that on a new architecture), or
explicitly allocate and reuse local variables, or remember which status
bits get whacked by which instructions, or try to remember the calling
registers or stack allocation for a called routine.

C does all this for you, at a small price in efficiency, but doesn't get
in your way like many other HLLs. I think the level of abstraction is just
right for most software that touches hardware. That is probably why most
OS, driver, and embedded software is written in it, and has been for 25
years. If you need more speed or more space, there are hard core
optimization options, and you can always profile and optimize by hand in
assembler.

Yet another good thing about C is that it's pretty standard. Nearly
everybody can read it after a few minutes instruction (unless you've
macroized it to look like cobol) Assembler with macros tends to look like
a private language, and intuiting higher level structures can be
daunting.

C was designed to be a portable assembly language, and, in my
opinion, does a great job at that task, and many others. Quick to write,
often portable, easy to read, handles annoying details that can be the
source of bugs, but lets you whack away at hardware without trying to
protect you from yourself. Flexible, malleable, can be used to write
drivers, operating systems, or AI. It's a good language.

--
Regards,
Bob Monsen

If a little knowledge is dangerous, where is the man who has
so much as to be out of danger?
Thomas Henry Huxley, 1877


.



Relevant Pages

  • Re: Hey, what is all this off topic posting?
    ... >>> that's all you're using macros for, I can see why you don't much like ASM. ... > PL/I language constructs though. ... >> write the macros using some arcane assembler to do that on a new ...
    (sci.electronics.design)
  • Re: Help...
    ... An Assembler is a Programming Tool that translates ... HLA does this. ... Macros and Equates substitutions features. ... difference between a language and the implementation of a language. ...
    (alt.lang.asm)
  • Re: HLA Stdlib v2.2 is now available.
    ... a language and an implementation of a language, ... it from being an assembler. ... You argue that the fact that the HLA ... the "user" can write their own macros and this makes all the ...
    (alt.lang.asm)
  • Re: "We Never Use Assembly Language"
    ... too bad that I expect the same from macros that I use. ... I guess Rosasm is no longer written in assembly. ... does not detract from a tool being an assembler. ... it raises HLA some levels. ...
    (alt.lang.asm)
  • Re: HLA Paren Rules
    ... macros do not violate "total control" principle because they are ... where two instructions map to the same exact machine code. ... JB and JC are the exact same instruction. ... modern programmer would not ever consider using an assembler as ...
    (alt.lang.asm)