home *** CD-ROM | disk | FTP | other *** search
- ;****************************************************************************
- ; Filename: PRINTF.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1995.02.09
- ; Updated: -
- ;****************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;****************************************************************************
- ; Function: ULONG printf(PSZ fmtstr,...);
- ; Comment: Prints a formatted string to STDOUT and returns the number of
- ; written characters.
- ; Input: fmtstr - printf format string
- ; ... - possible arguments
- ; Output: Number of characters written
- ;****************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
- Proc printf
- Mov Edx,[Esp+4]
- Lea Ecx,[Esp+8]
- Sub Esp,512 ; Allocates a 512 bytes buffer from
- Mov Eax,Esp ; the stack...
- Call @vprintf
- Mov Edx,Esp
- Mov Ecx,Eax
- Mov Eax,STDOUT
- Call @write
- Add Esp,512
- Ret
- Endp
-
- End