wstrings.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:26k
- #include "Config.h" // ZKR GL051004
- //BillTang_0524_2004_A: Comment out since the next condition blocks release compilation
- //#if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004
- #pragma inline
- #include "ServicesIncludeasmrules.h"
- #include <string.h>
- #include <mem.h>
- #if defined(__FARFUNCS__)
- #include <_farfunc.h>
- #endif
- /*-----------------------------------------------------------------------*
- Name wsetmem - sets memory to value
- Usage void wsetmem(void *addr, unsigned len, wchar_t val);
- Prototype in mem.h
- Description sets the len words of the block pointed to by addr to
- val
- Return value nothing
- *------------------------------------------------------------------------*/
- void _FARFUNC wsetmem(void _FAR *addr, size_t len, wchar_t val)
- {
- #if !(LDATA)
- _ES = _DS;
- #endif
- asm LES_ di, addr
- asm mov cx, len
- asm mov ax, val
- asm cld
- asm rep stosw
- }
- /*-----------------------------------------------------------------------*
- Name wcslen - calculates the length of a string
- Usage size_t wcslen(const wchar_t *str);
- Prototype in string.h
- Description returns the length of a null terminated string
- *------------------------------------------------------------------------*/
- #undef wcslen /* not an intrinsic */
- size_t _RTLENTRY _EXPFUNC wcslen(const wchar_t *str)
- {
- #if !(LDATA)
- asm mov ax,ds
- asm mov es,ax
- asm mov di,str
- asm xor ax,ax
- #else
- asm les di,str
- asm xor ax,ax
- asm cmp ax,W1(str)
- asm jne start
- asm cmp ax,di
- asm je out
- #endif
- start:
- asm cld
- asm mov cx, -1
- asm repne scasw
- asm xchg ax,cx
- asm not ax
- asm dec ax
- out:
- return(_AX);
- }
- /*-----------------------------------------------------------------------*
- Name wcscpy - copy string src to string dest
- Usage wchar_t *wcscpy (wchar_t *dest, const wchar_t *src);
- Prototype in string.h
- Description Copy the ASCIIZ string *src to the buffer *dest. It is the
- callers responsibility to ensure that the dest buffer is
- large enough to contain the string, and to guard against
- supplying NULL arguments.
- Return value wcscpy returns dest.
- *------------------------------------------------------------------------*/
- #undef wcscpy /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC wcscpy(wchar_t *dest, const wchar_t *src)
- {
- #if !(LDATA)
- _ES = _DS;
- #endif
- asm cld
- asm LES_ di, src
- asm mov si, di
- asm xor ax, ax
- asm mov cx, -1
- asm repne scasw
- asm not cx
- #if (LDATA)
- #if !defined(__HUGE__)
- asm push DS
- #endif
- _DS = _ES;
- #endif
- asm LES_ di, dest
- asm rep movsw
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm pop DS
- #endif
- return(dest) ;
- }
- /*---------------------------------------------------------------------*
- Name wcscat - appends one string to another
- Usage wchar_t *wcscat(wchar_t *destin, const wchar_t *source);
- Prototype in string.h
- Description wcscat appends a copy of source to the end of destin. The
- length of the resulting string is strlen(destin) +
- strlen(source).
- Return value returns a pointer dest
- *---------------------------------------------------------------------*/
- #undef wcscat /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC wcscat(wchar_t *dest, const wchar_t *src)
- {
- SaveSI
- SaveDI
- asm cld
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm push ds
- #endif
- #if LDATA
- asm les di, dest /* es:di = dest */
- #else
- asm mov di, dest /* es:di = dest */
- asm push ds
- asm pop es
- #endif
- asm mov dx, di /* save dest offset in dx */
- asm xor ax, ax
- asm mov cx, -1 /* find end of dest */
- asm repne scasw
- #if LDATA
- asm push es
- #endif
- asm lea si,[di-2] /* es:si points to terminating null in dest */
- asm LES_ di, src
- asm mov cx,-1 /* figure out strlen(src) */
- asm repne scasw
- asm not cx /* CX = strlen(src) + 1 */
- asm shl cx,1
- asm sub di,cx /* point es:di back to start of src */
- asm shr cx,1
- #if LDATA
- asm push es
- asm pop ds /* set DS: to seg of src */
- asm pop es /* restore ES: as seg of dest */
- #endif
- asm xchg si, di /* DS:SI = src, ES:DI = dest+strlen(dest) */
- asm rep movsw
- asm xchg ax, dx /* return addr of string */
- #if LDATA
- asm mov dx, es
- #endif
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm pop ds
- #endif
- #if LDATA
- return( (wchar_t *)(MK_LONG) );
- #else
- return( (wchar_t *)_AX );
- #endif
- }
- /*---------------------------------------------------------------------*
- Name wcschr - scans a string for the first occurrence of a
- given character
- Usage wchar_t *wcschr(const wchar_t *str, int c);
- Prototype in string.h
- Description wcschr scans a string in the forward direction, looking for a
- specific character. wcschr finds the first occurrence of the
- character ch in the string str.
- The null-terminator is considered
- to be part of the string, so that, for example
- wcschr(strs, 0)
- returns a pointer to the terminating null character of the
- string "strs".
- Return value wcschr returns a pointer to the first occurrence of the
- character ch in str; if ch does not occur in str, wcschr
- returns NULL.
- *---------------------------------------------------------------------*/
- #undef wcschr /* not an intrinsic */
- /* alias records for C++ implementation of wcschr() */
- #if !defined(__FARFUNCS__)
- #if defined(__LARGE__) || defined(__COMPACT__) || defined(__HUGE__)
- #pragma alias (@wcschr$qnxci, _wcschr)
- #pragma alias (@wcschr$qnci, _wcschr)
- #else /* defined __TINY__ or __SMALL__ or __MEDIUM__ */
- #pragma alias (@wcschr$qpxci, _wcschr)
- #pragma alias (@wcschr$qpci, _wcschr)
- #endif
- #endif
- wchar_t * _RTLENTRY _EXPFUNC wcschr(const wchar_t *s, int c)
- {
- asm cld
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm push ds
- #endif
- asm LDS_ si, s
- asm mov bx,c
- cmp_loop:
- asm lodsw /* get 1 wchar_t at a time */
- asm cmp ax, bx
- asm je success /* if first wchar_t matches */
- asm and ax, ax
- asm jnz cmp_loop /* continue if more characters */
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm pop ds
- #endif
- return( NULL );
- success:
- asm lea ax, [si-2] /* point AX at matching wchar_t */
- #if LDATA
- asm mov dx,ds
- #endif
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm pop ds
- #endif
- #if LDATA
- return( (wchar_t *)(MK_LONG) );
- #else
- return( (wchar_t *)_AX );
- #endif
- }
- /*-----------------------------------------------------------------------*
- Name wcscmp - compare one string to another
- Usage int wcscmp(const wchar_t *str1, const wchar_t str2);
- Prototype in string.h
- Description Compare *str1 with *str2, returning a negative, zero, or
- positive integer according to whether *str1 is less than,
- equal, or greater than *str2, respectively.
- Return value wcscmp return an integer value such as:
- < 0 if str1 is less than str2
- = 0 if str1 is the same as str2
- > 0 if str2 is greater than str2
- *------------------------------------------------------------------------*/
- #undef wcscmp /* not an intrinsic */
- int _RTLENTRY _EXPFUNC wcscmp(const wchar_t *str1, const wchar_t *str2)
- {
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov dx, ds
- #endif
- #if !(LDATA)
- asm mov ax, ds
- asm mov es, ax
- #endif
- asm cld
- /* Its handy to have AH & BH zero later for the final subtraction. */
- asm xor ax, ax
- asm mov bx, ax
- /* Determine size of 2nd source string. */
- asm LES_ di, str2
- asm mov si, di
- asm xor ax, ax
- asm mov cx, -1
- asm repne scasw
- asm not cx
- asm mov di, si
- asm LDS_ si, str1
- /*
- Scan until either *s2 terminates or a difference is found. Note that it is
- sufficient to check only for right termination, since if the left terminates
- before the right then that difference will also terminate the scan.
- */
- asm repe cmpsw
- /*
- The result is the signed difference of the final character pair, be they
- equal or different. A simple byte subtract and CBW doesn't work here because
- it does the wrong thing when the characters are 'ff' and '7f'. In that case
- 255 would be reported as less than 127. ie '80' sign extends to 'ff80' which
- is a negative number. Remember AH, BH are zero from above.
- */
- asm mov ax, [si-2]
- asm mov bx, ES_ [di-2]
- asm sub ax, bx
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov ds, dx
- #endif
- return _AX;
- }
- //int _RTLENTRY _EXPFUNC wcscoll(const wchar_t * __s1, const wchar_t * __s2);
- //size_t _RTLENTRY _EXPFUNC wcscspn(const wchar_t *__s1, const wchar_t *__s2);
- //wchar_t * _RTLENTRY _EXPFUNC _wcsdup(const wchar_t *__s);
- /*-----------------------------------------------------------------------*
- Name wcsncmp - compare one string to another
- Usage int wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen);
- Prototype in string.h
- Description Compare *str1 with *str2, returning a negative, zero, or
- positive integer according to whether *str1 is less than,
- equal, or greater than *str2, respectively.
- At most "maxlen" bytes will be compared. A "maxlen" of zero
- results in an equal compare, i.e. returns a zero.
- Return value wcsncmp return an integer value such as:
- < 0 if str1 is less than str2
- = 0 if str1 is the same as str2
- > 0 if str2 is greater than str2
- *------------------------------------------------------------------------*/
- #undef wcsncmp /* not an intrinsic */
- int _RTLENTRY _EXPFUNC wcsncmp(const wchar_t *str1, const wchar_t *str2, size_t maxlen)
- {
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov dx, ds
- #endif
- #if !(LDATA)
- asm mov ax, ds /* ES = DS */
- asm mov es, ax
- #endif
- asm cld
- /* Determine size of 2nd source string. */
- asm LES_ di, str2
- asm mov si, di
- asm mov ax, maxlen
- asm mov cx, ax
- asm jcxz ncm_end
- asm mov bx, ax
- asm xor ax, ax
- asm repne scasw
- asm sub bx, cx
- asm mov cx, bx
- asm mov di, si
- asm LDS_ si, str1
- /*
- Scan until either *s2 terminates, a difference is found, or "limit" is
- reached. Note that it is sufficient to check only for right termination,
- since if the left terminates before the right then that difference will
- also terminate the scan.
- */
- asm repe cmpsw
- /*
- The result is the signed difference of the final character pair, be they
- equal or different.
- We need to do the full word subtract here because ANSI requires unsigned
- comparisons. A simple byte subtract with a CBW would produce the wrong
- result in some cases.
- */
- asm mov ax, [si-2]
- asm mov bx, ES_ [di-2]
- asm sub ax, bx
- ncm_end:
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov ds, dx
- #endif
- return _AX;
- }
- /*-----------------------------------------------------------------------*
- Name wcsncpy - copy string src to string dest
- Usage wchar_t *wcsncpy (wchar_t *dest, const wchar_t *src, size_t maxlen);
- Prototype in string.h
- Description Copy the ASCIIZ string *src to the buffer *dest. It is the
- callers responsibility to ensure that the dest buffer is
- large enough to contain the string, and to guard against
- supplying NULL arguments.
- The length of source copied will be trimmed to maxlen
- bytes, including terminator. If *src is shorter than
- maxlen, then the target buffer is zero filled up to the
- maxlen.
- If the source needs to be truncated then the target is NOT
- zero terminated.
- Return value wcsncpy returns dest.
- *------------------------------------------------------------------------*/
- #undef wcsncpy /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC wcsncpy(wchar_t *dest, const wchar_t *src, size_t maxlen)
- {
- #if !(LDATA)
- asm mov ax, ds
- asm mov es, ax
- #endif
- asm cld
- asm LES_ di, src
- asm mov si, di
- asm xor ax, ax
- asm mov bx, maxlen
- asm mov cx, bx
- asm repne scasw
- asm sub bx, cx
- #if (LDATA)
- #if !defined ( __HUGE__ )
- asm push ds
- #endif
- asm mov di, es
- asm mov ds, di
- #endif
- asm LES_ di, dest
- asm xchg cx, bx
- asm rep movsw
- asm mov cx, bx
- asm rep stosw
- #if defined ( __LARGE__ ) || defined ( __COMPACT__ )
- asm pop ds
- #endif
- return(dest) ;
- }
- /*---------------------------------------------------------------------*
- Name _wcsnset - sets all characters in a string to a given
- character
- Usage wchar_t *wcsnset(wchar_t *str, wchar_t ch, size_t n);
- Prototype in string.h
- Description strnset sets up to the first n bytes of the string str to the
- character ch. If n > strlen(str), then strlen(str) replaces n.
- Return value pointer to str
- *---------------------------------------------------------------------*/
- #undef strnset /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC _wcsnset(wchar_t *s, wchar_t ch, size_t n)
- {
- unsigned len;
- len = wcslen(s);
- if (len < n)
- n = len;
- wsetmem(s, n, ch);
- return (s);
- }
- //wchar_t * _RTLENTRY _EXPFUNC wcspbrk(const wchar_t *__s1, const wchar_t *__s2);
- /*---------------------------------------------------------------------*
- Name wcsrchr - scans a string for the last occurrence of a
- given character
- Usage wchar_t *wcsrchr(const wchar_t *str, int c);
- Prototype in string.h
- Description wcsrchr scans a string in the reverse direction, looking for a
- specific character. wcsrchr finds the last occurrence of the
- character ch in the string str. The null-terminator is
- considered to be part of the string.
- Return value wcsrchr returns a pointer to the last occurrence of the
- character ch. If ch does not occur in str, wcsrchr returns
- NULL.
- *---------------------------------------------------------------------*/
- #undef wcsrchr /* not an intrinsic */
- /* alias records for C++ implementation of wcsrchr() */
- #if !defined(__FARFUNCS__)
- #if defined(__LARGE__) || defined(__COMPACT__) || defined(__HUGE__)
- #pragma alias (@wcsrchr$qnxci, _wcsrchr)
- #pragma alias (@wcsrchr$qnci, _wcsrchr)
- #else /* defined __TINY__ or __SMALL__ or __MEDIUM__ */
- #pragma alias (@wcsrchr$qpxci, _wcsrchr)
- #pragma alias (@wcsrchr$qpci, _wcsrchr)
- #endif
- #endif
- wchar_t * _RTLENTRY _EXPFUNC wcsrchr(const wchar_t *s, wchar_t c)
- {
- register const wchar_t *ss;
- register size_t i;
- for(i = wcslen( s ) + 1, ss = s+i; i; i--)
- {
- if( *(--ss) == (wchar_t)c ) return( (wchar_t *)ss );
- }
- return( 0 );
- }
- //wchar_t * _RTLENTRY _EXPFUNC _wcsrev(wchar_t *__s);
- /*---------------------------------------------------------------------*
- Name wcsset - sets all characters in a string to a given
- character
- Usage wchar_t *wcsset(wchar_t *str, int ch);
- Prototype in string.h
- Description strset sets all characters in the string str to the
- character ch.
- Return value pointer to str
- *---------------------------------------------------------------------*/
- #undef strset /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC _wcsset(wchar_t*s, wchar_t ch)
- {
- wsetmem(s, wcslen(s), ch);
- return (s);
- }
- //size_t _RTLENTRY _EXPFUNC wcsspn(const wchar_t *__s1, const wchar_t *__s2);
- /*-----------------------------------------------------------------------*
- Name wcsstr - scans a string for the occurrence of a given string
- Usage wchar_t *wcsstr(const wchar_t *str1, const wchar_t *str2);
- Prototype in string.h
- Description wcsstr scans str1 for the first occurrence of the substring
- str2.
- Return value wcsstr returns a pointer to the element in str1 that contains
- str2 (points to str2 in str1). If str2 does not occur in str1,
- wcsstr returns NULL.
- *------------------------------------------------------------------------*/
- #if (LDATA)
- #define pushES_ asm push ES
- #define popES_ asm pop ES
- #else
- #define pushES_
- #define popES_
- #endif
- /* alias records for C++ implementation of wcsstr() */
- #if !defined(__FARFUNCS__)
- #if defined(__LARGE__) || defined(__COMPACT__) || defined(__HUGE__)
- #pragma alias (@wcsstr$qnxct1, _wcsstr)
- #pragma alias (@wcsstr$qncnxc, _wcsstr)
- #else /* defined __TINY__ or __SMALL__ or __MEDIUM__ */
- #pragma alias (@wcsstr$qpxct1, _wcsstr)
- #pragma alias (@wcsstr$qpcpxc, _wcsstr)
- #endif
- #endif
- wchar_t * _RTLENTRY _EXPFUNC wcsstr(const wchar_t *str1, const wchar_t *str2)
- {
- if (!*str2)
- return((wchar_t *)str1); /* return str1 if str2 empty */
- pushDS_
- #if !(LDATA)
- _ES = _DS;
- #endif
- asm cld
- asm LES_ di, str1
- pushES_
- asm mov bx, di
- asm xor ax, ax
- asm mov cx, -1
- asm repnz scasw
- asm not cx
- asm xchg cx, dx
- asm LES_ di, str2
- pushES_
- asm mov bp, di
- asm xor ax, ax
- asm mov cx, -1
- asm repnz scasw
- asm inc cx
- asm not cx
- popDS_
- popES_
- strLoop:
- asm mov si, bp
- asm lodsw
- asm xchg di, bx
- asm xchg cx, dx
- asm repnz scasw
- asm mov bx, di
- asm jnz NotFound
- asm cmp cx, dx
- asm jnb FirstMatch
- NotFound:
- #if (LDATA)
- asm xor bx, bx
- asm mov es, bx
- #endif
- asm mov bx, 2
- asm jmp short End
- FirstMatch:
- asm xchg cx, dx
- asm jcxz End
- asm mov ax, cx
- asm dec cx
- asm repz cmpsw
- asm mov cx, ax
- asm jnz strLoop
- End:
- popDS_
- #if (LDATA)
- return (wchar_t _es *)(_BX - 2);
- #else
- return (wchar_t *)(_BX - 2);
- #endif
- }
- //wchar_t * _RTLENTRY _EXPFUNC wcstok(wchar_t *__s1, const wchar_t *__s2);
- /*---------------------------------------------------------------------*
- Name strncat - appends strings
- Usage wchar_t *strncat(wchar_t *destin, const wchar_t *source, size_t maxlen);
- Prototype in string.h
- Description strncat copies at most maxlen characters of source to the end
- of destin and then appends a null character. The maximum length
- of the resulting string is strlen(destin) + maxlen.
- Return value pointer to destin
- *---------------------------------------------------------------------*/
- #undef strncat /* not an intrinsic */
- wchar_t * _RTLENTRY _EXPFUNC wcsncat(wchar_t *dest, const wchar_t *src, size_t maxlen)
- {
- register unsigned len;
- unsigned dlen;
- dlen = wcslen(dest);
- len = wcslen(src);
- if (len > maxlen)
- len = maxlen;
- movmem((void *)src, dest + dlen, len << 1);
- dest[dlen + len] = 0;
- return (dest);
- }
- //wchar_t * _RTLENTRY _EXPFUNC wcspcpy(wchar_t *__dest, const wchar_t *__src);
- //wchar_t * _RTLENTRY _EXPFUNC _wcspcpy(wchar_t *__dest, const wchar_t *__src);
- /*-----------------------------------------------------------------------*
- Name stricmp - compare one string to another without case
- sensitivity
- Usage int stricmp(const wchar_t *str1, const wchar_t *str2);
- Prototype in string.h
- Description Case-independent comparison of *str1 with *str2. Compare
- the strings, but act as if upper and lower case characters
- were always upper-case, returning a negative, zero, or
- positive integer according to whether *str1 is less than,
- equal, or greater than *str2, respectively.
- The strings *str1 and *str2 are not changed.
- When comparing to punctuation characters alphabetics are
- always treated as upper-case.
- Return value strcmp return an integer value such as:
- < 0 if str1 is less than str2
- = 0 if str1 is the same as str2
- > 0 if str2 is greater than str2
- *------------------------------------------------------------------------*/
- int _RTLENTRY _EXPFUNC _wcsicmp(const wchar_t *str1, const wchar_t *str2)
- {
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov dx, ds
- #endif
- #if !(LDATA)
- asm mov ax, ds
- asm mov es, ax
- #endif
- asm cld
- asm LDS_ si, str1
- asm LES_ di, str2
- /*
- We setup some constants in registers because there's a slight payoff
- when the strings get longer than 3-4 characters (which should be most
- of the time in a typical program).
- */
- asm xor ax, ax /* AH and BH stay zero until the end */
- asm mov bx, ax /* when the final sub AX, BX is done */
- //asm mov cx, 617aH /* CH = 'a', CL = 'z' */
- cmi_nextCh:
- asm lodsw /* AL <- str1[i] */
- asm mov bx, ES_ [di] /* BL <- str2[i] */
- asm or ax, ax /* null terminator? */
- asm jz cmi_end
- asm scasw /* test & advance DI */
- asm je cmi_nextCh
- cmi_alUpper:
- asm cmp ax, 'a' /* str1[i] < 'a' */
- asm jb cmi_blUpper
- asm cmp ax, 'z' /* str1[i] > 'z' */
- asm ja cmi_blUpper
- asm sub ax, 'a'-'A' /* upper case str1[i] */
- cmi_blUpper:
- asm cmp bx, 'a' /* str2[i] < 'a' */
- asm jb cmi_compareAgain
- asm cmp bx, 'z' /* str2[i] > 'z' */
- asm ja cmi_compareAgain
- asm sub bx, 'a'-'A' /* upper case str2[i] */
- cmi_compareAgain:
- asm cmp ax, bx /* str1[i] == str2[i] */
- asm je cmi_nextCh
- cmi_end:
- /*
- We need to do the full word subtract here because ANSI requires unsigned
- comparisons. A simple byte subtract with a CBW would produce the wrong
- result in some cases. Remember that AH, BH are still zero.
- */
- asm sub ax, bx
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov ds, dx
- #endif
- return _AX;
- }
- //int _RTLENTRY _EXPFUNC _wcsnicmp(const wchar_t *__s1, const wchar_t *__s2, size_t __maxlen);
- /*-----------------------------------------------------------------------*
- Name wmemset - sets memory to value
- Usage void *wmemset(void *src, int c, size_t n);
- Prototype in mem.h
- Description sets the n word of the block pointed to by src to
- c.
- Return value src
- *------------------------------------------------------------------------*/
- void * _RTLENTRY _EXPFUNC _wmemset(void *src, int c, size_t n)
- {
- wsetmem( src, n, c );
- return( src );
- }
- //wchar_t * _RTLENTRYF _EXPFUNC _wcslwr(wchar_t *__s);
- //wchar_t * _RTLENTRYF _EXPFUNC _wcsupr(wchar_t *__s);
- //wchar_t * _RTLENTRYF _EXPFUNC _lwcslwr(wchar_t *__s);
- //wchar_t * _RTLENTRYF _EXPFUNC _lwcsupr(wchar_t *__s);
- /*-----------------------------------------------------------------------*
- Name _wmemcpy - copy a block of n bytes from src to dst
- Usage void *_wmemcpy(void *dst, const void *src, size_t n);
- Prototype in mem.h & string.h
- Description _wmemcpy copies a block of n bytes from src to dst.
- No overlap checking is performed.
- Return value _wmemcpy returns dst
- *------------------------------------------------------------------------*/
- void * _RTLENTRY _EXPFUNC _wmemcpy(void *dst, const void *src, size_t n)
- {
- #if !(LDATA)
- _ES = _DS;
- #endif
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov dx,ds /* save ds */
- #endif
- asm LES_ di, dst
- asm LDS_ si, src
- asm mov cx,n
- asm cld
- asm rep movsw
- #if defined(__LARGE__) || defined(__COMPACT__)
- asm mov ds,dx /* restore */
- #endif
- return(dst);
- }
- //BillTang_0524_2004_A: Comment out since the next condition blocks release compilation
- //#endif // #if defined(_DEBUG) || defined(D_RELEASE_TRACE_ENABLED) // ZKR GL051004