Subversion Repositories Kolibri OS

Rev

Rev 8793 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8793 Rev 9765
Line 1... Line -...
1
/* strcpy( char *, const char * )
-
 
2
 
-
 
3
   This file is part of the Public Domain C Library (PDCLib).
-
 
4
   Permission is granted to use, modify, and / or redistribute at will.
1
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
5
*/
-
 
6
 
-
 
7
#include 
2
#include 
Line 8... Line 3...
8
 
3
 
9
char * strcpy( char * s1, const char * s2 )
-
 
10
{
-
 
11
    char * rc = s1;
-
 
12
 
-
 
13
    while ( ( *s1++ = *s2++ ) )
4
char* strcpy(char* to, const char* from)
-
 
5
{
-
 
6
    int d0, d1, d2;
-
 
7
    __asm__ __volatile__(
14
    {
8
        "1:\tlodsb\n\t"
-
 
9
        "stosb\n\t"
15
        /* EMPTY */
10
        "testb %%al,%%al\n\t"
16
    }
-
 
-
 
11
        "jne 1b"
-
 
12
        : "=&S"(d0), "=&D"(d1), "=&a"(d2)
-
 
13
        : "0"(from), "1"(to)
17
 
14
        : "memory");
18
    return rc;
15
    return to;
19
}
16
}