home *** CD-ROM | disk | FTP | other *** search
- ;**********************************************************************************************************************************
- ; Filename: STPCPY.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1994.11.12
- ; Updated: -
- ;**********************************************************************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;**********************************************************************************************************************************
- ; Function: PSZ @stpcpy(PSZ dest,PSZ source);
- ; Input: Eax, dest - pointer to destination string
- ; Edx, source - pointer to source string
- ; Output: pointer to the end of the destination string
- ; Comment: Copies a string from <source> to <dest> and returns a pointer to the last byte in <dest>
- ;**********************************************************************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
-
- Proc stpcpy ,2
- jmp Start01
- Loop01: Add Eax,4
- Start01: Mov Ecx,[Edx]
- Add Edx,4
- TestZ Cl
- Jz Exit01
- TestZ Ch
- Jz Exit02
- Test Ecx,0FF0000h
- Jz Exit03
- Test Ecx,0FF000000h
- Mov [Eax],Ecx
- Jnz Loop01
- Add Eax,3
- Ret
- Align 4
- Exit03: Mov [Eax],Cx
- Mov [Byte Eax+2],0
- Add Eax,2
- Ret
- Align 4
- Exit02: Mov [Eax],Cx
- Inc Eax
- Ret
- Align 4
- Exit01: Mov [Eax],Cl
- Ret
- Endp
-
- End