Re: why this assembly language is not good?



On Wed, 05 Apr 2006 13:01:44 +0200, "¬a\\/b" <al@xxx> wrote:
I'm a hobby programmer (tipicaly 2-3 hours of programming for day)
How it is possible that in a language definited 100% wrong i a poor
beginner can write something like this?
In your opinion your professional "atoi" is better than my "ato_i"?

; eax __stdcall SrtToInt(char* string, char** pos)
; eg. char buf[256]={0}, *pc; int val=ato_i(buf, &pc);
; CF== carry flag
; format==<spaces><+|-><digits> where spaces={' ', '\t'}
; convert the number in format above in the 0 terminated
; string "string" in a integer in the range
; [-0x7FFFFFFF, 0x7FFFFFFF] that return in eax.
;
; if there is not a number in the above format then
; after the call => (string==pos and CF==0)
; if overflow for number > 0 return +0x7FFFFFFF CF==1
; if overflow for number < 0 return -0x7FFFFFFF CF==1
; if there is overflow it read all the number
; and save in "pos" the first not digit position
; in other cases save in "pos" the first not digit
; position and CF==0

why don't you write this useful function in your language of choice
and see if my assembly nasm implementation is better?

.



Relevant Pages

  • String interpolation
    ... I'm trying to do some string interpolation -- that is, ... static char* expand(const char *format) ... strncat(string, format, pos); ...
    (comp.lang.c)
  • Re: Date format detection
    ... Specifies the locale for which the date string is to be formatted. ... date format for this locale. ... the system default-date format for the specified locale. ... be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date format detection
    ... > Specifies the locale for which the date string is to be formatted. ... > date format for this locale. ... > the system default-date format for the specified locale. ... > be enclosed within single quotation marks in the date format picture. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Date confusion
    ... Read my reply elsewhere in this string. ... > integer portion of the value represents the date as the number of days ... >> If you are working with a numeric date and you want the format DDMMYYYY, ... Another reason for preferring to store a date as text would be personal preference. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Regular Expression - old regex module vs. re module
    ... If you want to include backslashes in a string, ... a one character string, which is unlikely to be what you wanted. ... formating characters before a format, then you should use a negative ... #read in and parse a format template ...
    (comp.lang.python)