Re: Formatting in assembly
- From: "Dragontamer" <prtiglao@xxxxxxxxx>
- Date: 31 Mar 2006 06:20:13 -0800
James Daughtry wrote:
¬a\/b wrote:
main:
call 'msvcrt._write',1,msg1,D$msg1_len
call 'msvcrt._read',0,buf,blen
dec eax | mov D$n,eax
call atoi,buf,D$n
call itoa,result,eax,D$n
call 'msvcrt._write',1,result,D$n
ide_exit
msvcrt._write(1,msg1,D$msg1_len);
etc
....
/* if return 1 OK, if return 0 error
itoa:
j=[s+4]; a=[s+8]; c=[s+12]; 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:
ret
NOT TESTED
What language is that? :-)
Everyone has their "perfect assembly language" :)
BTW: Herbert's is x86 assembly, seems to be a mix of Gas and some other
assembler I don't know.
--Dragontamer
.
- References:
- Formatting in assembly
- From: James Daughtry
- Re: Formatting in assembly
- From: ¬a\\/b
- Re: Formatting in assembly
- From: James Daughtry
- Formatting in assembly
- Prev by Date: Re: Formatting in assembly
- Next by Date: Re: Formatting in assembly
- Previous by thread: Re: Formatting in assembly
- Next by thread: SpooK, its put up or shut up time.
- Index(es):
Relevant Pages
|