Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Chuck Crayne <ccrayne@xxxxxxxxxx>
- Date: Thu, 6 Mar 2008 21:09:31 -0800
On Wed, 05 Mar 2008 10:46:19 +0100
Herbert Kleebauer <klee@xxxxxxxxx> wrote:
What is better readable, C or assembly?
I don't want to get bogged down in arguing over definitions, but I
would like to suggest that there are two distinct levels of
readability. To illustrate this, consider this line of code from the
Nasm source:
if (pass0 == 1 || (!is_norm && !isextrn && (segment & 1))) {
From the standpoint of what the cpu will do with the code generated
from this statement, it is quite readable to anyone who knows C.
However, as Frank recently brought to my attention, there is a bug in
this code line, the symptom of which is that statements such as
foo equ 42
result in "foo" being added to the symbol table twice, if and only if
the optimization level is greater than one. There is, of course, no
diagnostic message to help one find this bug.
The problem is that there is not enough information in the code line to
allow one to determine what the the programmer intended the code to do.
It is this second, and much more important, level of readability which
is so often lacking in HLL code.
--
Chuck
http://www.pacificsites.com/~ccrayne/charles.html
.
- Follow-Ups:
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Herbert Kleebauer
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- References:
- Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Pop Tart
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Herbert Kleebauer
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Pop Tart
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Frank Kotler
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Pop Tart
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Frank Kotler
- Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- From: Herbert Kleebauer
- Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- Prev by Date: Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- Next by Date: Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- Previous by thread: Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- Next by thread: Re: Linux / NASM equivalent of Iczelion's Win32 assembly tut's
- Index(es):
Relevant Pages
|