I'll keep this short...

Having spent years working on products written entirely in assembler
(large operating systems and assorted applications) as well as
products written entirely or nearly so in high level languages, I have
this observation:

Standard coding style for software written in assembler is that most
source lines have a comment on them.  The comment states what the line
does, since the opcode and register names generally don't carry that
much information.  (In particular, even though *some* assemblers allow
it, the use of mnemonic names for registers is highly unusual.)  This
is in addition to the "block comment" at the top of each function,
where the purpose of the function, registers in/out/clobbered etc. are
documented.

Conversely, standard coding style for high level language code is to
have the function level block comment only, except in large and
complex functions where block comments at smaller intervals are
sometimes used.  But line by line comments are not used since the code
itself can be clear enough.

My impression of Linux assembler code -- and this is not particularly
aimed at Russell, since I've spent more time looking at other people's
code -- is that it is documented C-style rather than traditional
assembler style.  That makes sense if you consider that it's written
by people who do most of their coding in C.

      paul

unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++        Please use [EMAIL PROTECTED] for           ++
++                        kernel-related discussions.                      ++

Reply via email to