Metropoli BBS
VIEWER: xtoa.asm MODE: TEXT (ASCII)
;****************************************************************************
; Filename: XTOA.ASM
;   Author: Peter Andersson
;  Version: 0.0
;  Created: 1995.02.09
;  Updated: -
;****************************************************************************
; Copyright Peter Andersson, 1994-1995.
; All rights reserved.
;****************************************************************************
; Function: PSZ @xtoa(ULONG value,PSZ string);
;    Input: Eax, value - value to convert to a hex string
;           Edx, string - pointer to the storage string
;   Output: pointer to the storage string
;  Comment: Converts a value to a hex string
;****************************************************************************

        Include STDDEF.INC

        Codeseg

Extrn NumberConvert:Byte

Proc    xtoa    ,2
                Sub     Esp,12
                Push    Edx
                Lea     Edx,[Esp+4+11]
                Clear   Ecx
                Mov     [Byte Edx],0
@@Loop:         Mov     Cl,Al
                And     Cl,0Fh
                Dec     Edx
                Mov     Cl,[Ecx+NumberConvert]
                Shr     Eax,4
                Mov     [Edx],Cl
                Jnz     @@Loop
                Mov     Eax,[Esp]
                Call    @stpcpy
                Mov     Edx,Eax
                Pop     Eax,+12
                Ret
Endp

        End

[ RETURN TO DIRECTORY ]