;****************************************************************************
; Filename: OTOA.ASM
; Author: Peter Andersson
; Version: 0.0
; Created: 1995.02.09
; Updated: -
;****************************************************************************
; Copyright Peter Andersson, 1994-1995.
; All rights reserved.
;****************************************************************************
; Function: PSZ @otoa(ULONG value,PSZ string);
; Input: Eax, value - value to convert to an octal string
; Edx, string - pointer to the storage string
; Output: pointer to the storage string
; Comment: Converts a value to an octal string
;****************************************************************************
Include STDDEF.INC
Codeseg
Extrn NumberConvert:Byte
Proc otoa ,2
Sub Esp,12
Push Edx
Lea Edx,[Esp+4+11]
Clear Ecx
Mov [Byte Edx],0
@@Loop: Mov Cl,Al
And Cl,07h
Dec Edx
Mov Cl,[Ecx+NumberConvert]
Shr Eax,3
Mov [Edx],Cl
Jnz @@Loop
Mov Eax,[Esp]
Call @stpcpy
Mov Edx,Eax
Pop Eax,+12
Ret
Endp
End