Re: Formatting in assembly



Betov wrote:
Herbert Kleebauer <klee@xxxxxxxxx> écrivait news:442CFC6B.82DF6D79

if you read a single line, you have to move your eyes
from left to right to left to right

Yes. This is what you do each time you read any post,
on this News Group.

No, I said "if you read a single line". Show me a single line
in the text below, where you have to move your eyes "from left
to right to left to right"

But:
if
this is
really a_problem
for your
I promiss


But the C compiler generates much better code than
anything posted here (and the C source is also much better
readable than anything posted here):

unsigned int a2i(p,n) char *p; unsigned int n;
{int result=0;
while (n--) {result = result*10 + (*p++ -'0');}
return result;
}

_p$ = 8
_n$ = 12
_a2i PROC
mov ecx, DWORD PTR _n$[esp-4]
xor eax, eax
test ecx, ecx
je SHORT $LN6@a2i
mov edx, DWORD PTR _p$[esp-4]
push esi
npad 1
$LL2@a2i:
movsx esi, BYTE PTR [edx]
sub ecx, 1
lea eax, DWORD PTR [eax+eax*4]
add edx, 1
test ecx, ecx
lea eax, DWORD PTR [esi+eax*2-48]
jne SHORT $LL2@a2i
pop esi
$LN6@a2i:
ret 0
.



Relevant Pages

  • Re: misc: a few operations (long long division?...)
    ... eax, ecx, edx, ebx, ebp, esi, and edi. ...
    (alt.lang.asm)
  • misc: a few operations (long long division?...)
    ... push ebx; push ecx ... push edi; push esi ... push edx; push eax ... bt edx, 31; jnc .l1 ...
    (alt.lang.asm)
  • Re: Fastcode Int64Div
    ... mov edx, ... push esi // Save ESI as per calling convention. ... push edi // Save EDI as per calling convention. ... mov esi, ecx // divisor_hi ...
    (borland.public.delphi.language.basm)
  • Re: Fastcode Int64Div
    ... push esi // Save ESI as per calling convention. ... push edi // Save EDI as per calling convention. ... mov esi, ecx // divisor_hi ... mov edi, edx // dividend_hi ...
    (borland.public.delphi.language.basm)
  • Re: Fastcode PosEx B&V 0.5
    ... cmp ecx, $01 ... mov ebp, ... mov esi, ... test ecx, $000000FF ...
    (borland.public.delphi.language.basm)