conversion d'un nombre pour montrer sur l'ecran(to string)
Publié : sam. 02/juin/2007 0:57
Bonjour a tous,
Une autre conversion
nombre a chaine (Number to string)
Excusez mon francais je n'ai pas d'experience en francais dans les ordinateurs.(30 ans d'anglais)
gebe 
Une autre conversion
nombre a chaine (Number to string)
Excusez mon francais je n'ai pas d'experience en francais dans les ordinateurs.(30 ans d'anglais)
Code : Tout sélectionner
;was not tested for speed(n'a pas ete' teste' pour la vitesse)
;only an exercise, seulement un exercice
Procedure StrL(l.l,*p)
!MOV eax,dword[p.v_l]
! PUSH edi;+4 for the push
! MOV edi,dword[p.p_p+4];the pointer value adapte' pour le push
! MOV dl ,255 ;make end marker,marque de fin
! PUSH edx ;<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
!MOV ecx ,10 ;
! x0:
!MOV edx ,0
!DIV ecx ; divide eax by 10
!PUSH edx ; save the rest <<<<<<<<<<<<<<<<<<<<<<<
!CMP eax ,0; result of division
!JA x0 ; is eax 0 ? finished ?
!x2:
!POP eax ; start getting back the results of divisions>>>>>>>>>>>>recuperer les resultats
!CMP al ,255 ; untill start/end marker found
!JE x9
!ADD al ,'0'
!STOSB
!JMP x2
! x9:
!MOV al,0
!STOSB ; finished ZERO TERMINATING,mettre un zero
! POP edi ; restore edi>>>>>>>>>>>>>>>>>>>>>>>>>
EndProcedure
;ALLOCATION OF SPACE
st.s="00000000000000"
Debug st
b.l=19191919;number to convert
Strl(b,@st);or stp
Debug st
End
