home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / CONIO / PRINTF.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  1.0 KB  |  38 lines

  1. ;****************************************************************************
  2. ; Filename: PRINTF.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.02.09
  6. ;  Updated: -
  7. ;****************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;****************************************************************************
  11. ; Function: ULONG printf(PSZ fmtstr,...);
  12. ;  Comment: Prints a formatted string to STDOUT and returns the number of
  13. ;           written characters.
  14. ;    Input: fmtstr - printf format string
  15. ;           ... - possible arguments
  16. ;   Output: Number of characters written
  17. ;****************************************************************************
  18.  
  19.     Include    STDDEF.INC
  20.  
  21.     Codeseg
  22.  
  23. Proc    printf
  24.         Mov    Edx,[Esp+4]
  25.         Lea    Ecx,[Esp+8]
  26.         Sub    Esp,512        ; Allocates a 512 bytes buffer from
  27.         Mov    Eax,Esp        ; the stack...
  28.         Call    @vprintf
  29.         Mov    Edx,Esp
  30.         Mov    Ecx,Eax
  31.         Mov    Eax,STDOUT
  32.         Call    @write
  33.         Add    Esp,512
  34.         Ret
  35. Endp
  36.  
  37.     End
  38.