Re: Formatting in assembly
- From: Betov <betov@xxxxxxx>
- Date: 31 Mar 2006 07:17:37 GMT
"James Daughtry" <mordock32@xxxxxxxxxxx> écrivait
news:1143764835.713649.236330@xxxxxxxxxxxxxxxxxxxxxxxxxxxx:
atoi:
mov esi,D$esp+4 | mov ecx,D$esp+8
mov eax,0
L0: jecxz L1>
; Convert from ASCII, add to LSD
movzx ebx,B$esi | sub ebx,'0'
mov edx,10 | mul edx | add eax,ebx
inc esi | dec ecx
jmp L0<
L1:
ret
* "atoi" is not an acceptable name.
* All Local Labels should by in Row 1
----------------------------------------------------
Proc AsciiToEax:
Arguments @Buffer, @NumberOfChars
Uses esi, ebx, ecx, edx
mov esi D@Buffer, ecx D@NumberOfChars
mov eax 0, ebx 0, edx 10
While ecx > 0
mul edx
mov bl B$esi | sub bl '0' | add eax ebx
inc esi | dec ecx
End_While
EndP
----------------------------------------------------
Betov.
< http://rosasm.org >
.
- Follow-Ups:
- Re: Formatting in assembly
- From: Dragontamer
- Re: Formatting in assembly
- From: Herbert Kleebauer
- Re: Formatting in assembly
- From: hutch--
- Re: Formatting in assembly
- References:
- Formatting in assembly
- From: James Daughtry
- Formatting in assembly
- Prev by Date: Re: Why use assembly?
- Next by Date: Re: Cherche des experts en assembleur
- Previous by thread: Re: Formatting in assembly
- Next by thread: Re: Formatting in assembly
- Index(es):
Relevant Pages
|