Assembly or ....

Frank Wales frank at zen.co.uk
Mon Nov 28 21:17:24 AEST 1988


In article <1961 at crete.cs.glasgow.ac.uk> orr at cs.glasgow.ac.uk
(Fraser Orr) writes:
>In article <729 at convex.UUCP> dodson at mozart.UUCP (Dave Dodson) writes:
>>I believe it is important to learn assembly language for some computer
>>because that is how you learn how computers _really_ work.  This knowledge
>>can help you program better in any language.
>
>Do you think it is important to understand how transistors work as well?

For some problems, yes.  And caches, pipelines, and all the other 
diddly bits that make computers go these days.  Being a mechanic won't
necessarily improve your driving abilities; but it can't hurt, and you
never know when it might be useful.

>The semantic level of most mircoprocessors is high enough that
>learning a HLL is pretty much sufficient these days (compare 68000 asm
>to C for example.) In the good old days, when men were men and transistors
>were valves, I think your statment was true. I also think that you needed
>a fair understanding of how the electronics worked. As things have developed
>I think the abstract level, that it is necessary to understand computers at,
>has been slowly progressing upward.

The problems being attacked using computers today are bigger than ever,
so the levels of abstraction which need to be used to make them
comprehensible to those who would solve them must also expand to fit 
(and with them, the tools in use).  But this does not mean that the
level of detail at the lowest level has become any less -- indeed, things
have become more complex down there too.  We now have tools
which are sufficiently powerful and flexible that most of the time we can
forget about the low-level, implementation-type details in favour of
the higher-level, problem-solving details.  But only most of the time,
not all of it.  You may never have come across a problem requiring you
to delve into the depths of assembler (or microcode, etc.), but that
doesn't mean such problems don't exist.

>I don't agree that there is ever any necessity to code in assembler. We
>have languages that produce code just as good as hand crafted assembler
>(such as C), so why not use them for this sort of thing.

[Ignoring the wishful thinking in that comment...]
Suppose you don't have a compiler.  Or an assembler.  Suppose you're writing
these for a brand new processor -- what do you write them in?

>As to your comments on portability, your implication seems to be that
>the reason you use a  HLL is to facilitate portibility, the reason I use
>then is that they are easier to code in, easier to debug, and easier
>to maintain ( particularly by people that didn't write the code originally).

That's a subjective assessment which isn't always borne out in practice;
some things can be easier to write in assembler -- again, it depends on
the level of detail required by the problem to hand.  No-one in their
right mind writes an operating system entirely in assembler; but they don't
write them entirely in C (Pascal, Ada, Modula-2, ...) either.

>As to assembler being more readable, I think that assembler is not very
>sutiable for any task at hand.

Then you have a fortuitously-positioned hand.

--
Frank Wales, Software Consultant,    [frank at zen.co.uk<->mcvax!zen.co.uk!frank]
Zengrange Ltd., Greenfield Rd., Leeds, ENGLAND, LS9 8DB. (+44) 532 489048 x217 



More information about the Comp.lang.c mailing list