From: Maciej Hrebien <m_hrebien@wp.pl>
To: linux-assembly@vger.kernel.org
Subject: Re: Does anyone code in assembler today?
Date: Sun, 21 Sep 2003 12:19:00 +0200 [thread overview]
Message-ID: <3F6D7B14.C37A3152@wp.pl> (raw)
In-Reply-To: 200309180835.05190.jko@save-net.com
jeff wrote:
>
> On Wednesday 17 September 2003 11:31 pm, Frederic Marmond wrote:
> > I'm sad to say that assembly is baddly considered by most of 'new'
> > programmers,
>
> I think this is true of assembler programmers also. Some think it is
> difficult and use it for small projects. Other programmers
> find it easy and use it for big projects.
>
> This difference is interesting. What makes assembler useful
> for some programmers and of limited use for others? I know some
> of the answers but it is a complicated question. Here are some
> facts that look accurate to me:
>
> 1. Assembly can easily turn into a nightmare of spaghetti
> code. This requires functions and modules to be created
> carefully and at lower levels than other languages.
> 2. Most Assembler tools are awful and new programmers have
> not encountered good tools.
> 3. People are different and some people do not want to think
> about registers and such.
> 4. It is easy to make assembler difficult for others to understand.
> The use of macros and uncommented subroutines soon create a
> language only readable by the original programmer.
> 5. A good assembler library can make coding speed and results about
> the same as a high level language. Now, this point will probably
> create some argument. About the only way to prove it would be
> to have some timed trials. I've done a few over the years and
> found it true but creating the library in the first place was a big job.
>
> It is interesting we now have thousands of languages and still people
> are working on new languages. All these languages are not much different
> from assembler with different libraries.
[ cut ]
All you say is true. With comparition to HLLs assembly is more
powerfull, flexible, not generalized like all HLLs, gives you more
control on code the cpu is executing, so any speed/size optimizations
can take place. It gives you possibility to use some special units of
cpu or the computer system as a whole. Generalizing: it makes possible
to use all features the computer system can offer & control them as you
wish.
I think people turn into assembly only if they want such power, they
want to know exactly what's going on & want to have control in details,
sometimes bit-details. Of course not even mention cases where assembly
is the only way to do the job.
Yes, people are diffrent & they "talk" in diffrent languages. Some of
them like more hardware focus in daily coding but some are focused only
on their data structures & algorithms and want to think only in
genaralized way without wondering what cpu will run their algorithms &
how it achieve this.
So there is another reason why more poeple stay in HLLs: they just want
their code to be more portable/machine independent & HLLs like ie. C
gives you (more or less) this advantage.
If we talk about generalization & bits, look at this very simple
example:
const bool carry = x&(1<<(sizeof(x)*8-1));
x = (x<<1)|carry;
Yes, it's simple rol. But look what a compiler will (possibly) generate:
lea (%eax,%eax),%ebx
shr $31,%eax
or %ebx,%eax
not just: rol $1,%eax. Comment it by yourself, in your language.. ;)
Yes, some tools are awful but don't forget we are mammals - we are
getting used to while using this tools more & more.. ;)
Regards,
--
Maciej Hrebien
next prev parent reply other threads:[~2003-09-21 10:19 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-11 11:01 I/O Rafael Diniz
2003-09-11 11:07 ` I/O Rudolf Marek
2003-09-11 13:21 ` I/O peter w krause
2003-09-15 14:30 ` Assembler Tools jeff
2003-09-16 2:15 ` Rafael Diniz
2003-09-17 17:20 ` Does anyone code in assembler today? jeff
2003-09-17 18:20 ` myrkraverk
2003-09-18 6:31 ` Frederic Marmond
2003-09-18 7:57 ` peter w krause
[not found] ` <3F696702.9040407@eprocess.fr>
2003-09-18 10:46 ` peter w krause
2003-09-18 16:10 ` jeff
2003-09-21 10:19 ` Maciej Hrebien [this message]
2003-09-21 12:05 ` Stephen Satchell
2003-09-22 9:53 ` peter w krause
2003-09-18 13:00 ` linuxassembly
2003-09-16 2:42 ` Art of Assembly Is Real! Randall Hyde
2003-09-16 6:54 ` Brien B.
-- strict thread matches above, loose matches on Subject: below --
2003-09-18 12:48 Does anyone code in assembler today? Jason Roberts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F6D7B14.C37A3152@wp.pl \
--to=m_hrebien@wp.pl \
--cc=linux-assembly@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).