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

  1. ;**********************************************************************************************************************************
  2. ; Filename: STPCPY.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1994.11.12
  6. ;  Updated: -
  7. ;**********************************************************************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;**********************************************************************************************************************************
  11. ; Function: PSZ @stpcpy(PSZ dest,PSZ source);
  12. ;    Input: Eax, dest - pointer to destination string
  13. ;           Edx, source - pointer to source string
  14. ;   Output: pointer to the end of the destination string
  15. ;  Comment: Copies a string from <source> to <dest> and returns a pointer to the last byte in <dest>
  16. ;**********************************************************************************************************************************
  17.  
  18.     Include    STDDEF.INC
  19.  
  20.     Codeseg
  21.  
  22.  
  23. Proc    stpcpy  ,2
  24.                 jmp Start01
  25. Loop01:        Add    Eax,4
  26. Start01:    Mov    Ecx,[Edx]
  27.         Add    Edx,4
  28.         TestZ    Cl
  29.         Jz    Exit01
  30.         TestZ    Ch
  31.         Jz    Exit02
  32.         Test    Ecx,0FF0000h
  33.         Jz    Exit03
  34.         Test    Ecx,0FF000000h
  35.         Mov    [Eax],Ecx
  36.         Jnz    Loop01
  37.         Add    Eax,3
  38.         Ret
  39.     Align    4
  40. Exit03:        Mov    [Eax],Cx
  41.         Mov    [Byte Eax+2],0
  42.         Add    Eax,2
  43.         Ret
  44.     Align    4
  45. Exit02:        Mov    [Eax],Cx
  46.         Inc    Eax
  47.         Ret
  48.     Align    4
  49. Exit01:        Mov    [Eax],Cl
  50.         Ret
  51. Endp
  52.  
  53.     End
  54.