Re: Formatting in assembly
- From: "Dragontamer" <prtiglao@xxxxxxxxx>
- Date: 31 Mar 2006 07:41:49 -0800
Betov wrote:
"Dragontamer" <prtiglao@xxxxxxxxx> écrivait news:1143814436.470493.227460
@i40g2000cwc.googlegroups.com:
* "atoi" is not an acceptable name.
Why not?
Because there is no "atoi", in my English distionary.
And "i", the index counter in a loop isn't in the English Dictionary
either.
Well, at least it doesn't mean what it says in the dictionary :) Nor
does L0
btw.
Point being: this is very known HLL convention, and *many* functions
follow this
convention.
http://minix1.woodhull.com/manpages/man3/hton.3.html
http://www.cplusplus.com/ref/cstdlib/
hton
ntoh
atoi <--- from C std library.
atol
atof
etc. etc. More examples out there I'm sure.
Actually, a few linux tools have similar names as well. a2ps for
example.
It isn't "atops" but it is close enough for you to get what I mean.
I understand it perfectly: Ascii to Integer.
Good for you, but is supppose that, if you know of it,
this is because you have _LEARNed_ what these chars
were meaning. Then, the day you will write something
for a beginner, you will say:
-----------------------------
; Convert Ascii to Integer:
atoi:
-----------------------------
... which by the way, is not exact. This is:
-----------------------
; Convert Ascii to EAX:
-----------------------
... but achieving in all cases into bad naming. If this
is "Ascii to EAX", then the Routine Name is "AsciiToEax",
and nothing else.
Good code must have few comments, and, instead of useless
comments, must rely on fully "Self-Descriptive-Names", as
long as, once done, there is no more any requirement for
commenting, depending on the level of education of the
reader.
You gonna tell me how I write? I like how you assume I'm going
to make a comment, and then make a bad comment instead of
a good comment, and then on top of that, that I write for beginners
and make useless comments for them.
Hmm... too many assumptions I assume :)
Now, you may not be familiar with this convention, being stuck in
assembly. But I assure you; it is a common enough convention. It
is as common as using ecx for addressing memory inside a loop.
The name is completly descriptive. Ascii to Integer. Everything is
returned in eax by convention as well, so why should it be named
Ascii to Eax? Eax can be any 32-bit value. Heck, it could be a float,
a memory pointer, etc.
--Dragontamer
.
- References:
- Formatting in assembly
- From: James Daughtry
- Re: Formatting in assembly
- From: Betov
- Re: Formatting in assembly
- From: Dragontamer
- Re: Formatting in assembly
- From: Betov
- Formatting in assembly
- Prev by Date: Re: The rats nets show
- Next by Date: Re: Formatting in assembly
- Previous by thread: Re: Formatting in assembly
- Next by thread: Re: Formatting in assembly
- Index(es):
Relevant Pages
|