Re: Formatting in assembly




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

.



Relevant Pages

  • Re: ASCII convention
    ... in article, a well known arabist recommends italics, and criticisez an author using /... ... / which is not possible in an ASCII post. ... convention in plain ASCII text if you thought that you italics is *always* used. ... If the question is really about _plain text_ and specifically _Usenet postings_, then there's a particular thing to note about using the solidus character as a delimiter on Usenet. ...
    (sci.lang)
  • Re: ASCII convention
    ... > what is the recommended convention for representing *letters* which may ... > convention in plain ASCII text if you thought that you italics is ... > not in plain text. ... for my own use in posts. ...
    (sci.lang)
  • Re: The Art of Pickling: Binary vs Ascii difficulties
    ... never read the ASCII spec before. ... so before the C convention was defined. ... the printing position to the next printing line. ... So it seems that it's not a violation, ...
    (comp.lang.python)
  • Re: How to exit a For-Next in a nested Switch statement?
    ... there is convention that states that code should manipulate ... Alvin Bruney ... > to the max so the loop drops out naturally on it's next itteration. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Counting nested loop iterations
    ... but x is used after the loop which creates it. ... Seems to be a matter of convention all the time. ... But I'm a happy camper with list-comps and the new ...
    (comp.lang.python)