My contribution,after (finally)

"understanding"the 2 different ways of using
machine code.C type conversion ,using a buffer.
gebe
Code: Select all
]
;was not tested for speed
;only an exercise
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
! MOV dl ,255 ;make end marker
! 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>>>>>>>>>>>>
!CMP al ,255 ; untill start/end marker found
!JE x9
!ADD al ,'0'
!STOSB
!JMP x2
! x9:
!MOV al,0
!STOSB ; finished ZERO TERMINATING
! 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