home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / STRINGS / STRDUP.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  829 b   |  33 lines

  1. ;******************************************************************************
  2. ; Filename: STRDUP.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.03.12
  6. ;  Updated: 
  7. ;******************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;******************************************************************************
  11. ; Function: PSZ @strdup(PSZ str)
  12. ;  Comment: Duplicates a string
  13. ;  Returns: Pointer to the duplicated string or null if out of memory
  14. ;******************************************************************************
  15.  
  16.     Include    STDDEF.INC
  17.  
  18.     Codeseg
  19.  
  20. Proc    strdup  ,1
  21.         Push    Eax
  22.         Call    @strlen
  23.         Inc    Eax
  24.         Call    @malloc
  25.         TestZ    Eax
  26.         Jz    @@Exit01
  27.         Pop    Edx
  28.         Call    @strcpy
  29. @@Exit01:    Ret
  30. Endp
  31.  
  32.     End
  33.