Re: Formatting in assembly



On Fri, 31 Mar 2006 10:45:20 +0200, "¬a\\/b" <al@xxx> wrote:
/* if return 1 OK, if return 0 error
itoa:

here everyone have to push ebx, edi, esi

j=[s+4]; a=[s+8]; c=[s+12]; b=10;

j=[s+4+4*3]; a=[s+8+4*3]; c=[s+12+4*3]; b=10;

c<>1; <#.ce; =#.c5;
.c0: { r=0; div b; /* r=a%10, a=a/10
rl+='0'; *j=rl; ++j; a==0#.c2;
.c1: --c#.c0;
}
.c2: i=[s+4]; B*j=0; c==0#.ce; --j;
#.c4;
.c3: {al=*i; *j<->al; *i=al; --j; ++i;
.c4: i<j#.c3
}
a=1;#.cf;
.c5: B*j=0;
.ce: a=0
.cf:

and pop here ebx, esi, edi

ret

NOT TESTED

.



Relevant Pages

  • Can a C compiler compete with assembler ?
    ... I have kept hearing that assembler programmers cannot compete with a C ... mov edi, ... lea esi, ... cmp esi, ...
    (comp.lang.asm.x86)
  • Re: Optimierung: Bilder blenden
    ... Nach links schieben damit man PMULHW verwenden kann... ... mov EDI, Dest ... mov ESI, Src1 ... shl EDX, 4 ...
    (de.comp.lang.assembler.x86)
  • Re: Some thoughts re the MM benchmarks
    ... without any concurrency to see the difference the "lock" prefix makes. ... mov ecx, DATA_LENGTH ... mov esi, eax ... mov edi, edx ...
    (borland.public.delphi.language.basm)
  • Re: Dont be overawed by a C compiler.
    ... | cmp ecx, edx ... | mov eax, rgt ... | mov edi, lft ... | mov esi, rgt ...
    (comp.lang.asm.x86)
  • Re: some advice
    ... >> uses ecx, edx, esi, edi ... > mov ebp, esp ... 'add eax, 1' works better than 'dec eax' ...
    (alt.lang.asm)