diff options
Diffstat (limited to 'lib/libc/i386/string/bcopy.S')
-rw-r--r-- | lib/libc/i386/string/bcopy.S | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/libc/i386/string/bcopy.S b/lib/libc/i386/string/bcopy.S index 1a6762c..6d99938 100644 --- a/lib/libc/i386/string/bcopy.S +++ b/lib/libc/i386/string/bcopy.S @@ -32,12 +32,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bcopy.S,v 1.1 1994/08/05 01:18:24 wollman Exp $ + * $Id: bcopy.S,v 1.2 1995/01/23 01:28:49 davidg Exp $ */ #if defined(LIBC_RCS) && !defined(lint) .text - .asciz "$Id: bcopy.S,v 1.1 1994/08/05 01:18:24 wollman Exp $" + .asciz "$Id: bcopy.S,v 1.2 1995/01/23 01:28:49 davidg Exp $" #endif /* LIBC_RCS and not lint */ #include "DEFS.h" @@ -53,8 +53,10 @@ ENTRY(bcopy) movl 12(%esp),%esi movl 16(%esp),%edi movl 20(%esp),%ecx - cmpl %esi,%edi /* potentially overlapping? */ - jnb 1f + movl %edi,%eax + subl %esi,%eax + cmpl %ecx,%eax /* overlapping? */ + jb 1f cld /* nope, copy forwards. */ shrl $2,%ecx /* copy by words */ rep @@ -69,10 +71,10 @@ ENTRY(bcopy) 1: addl %ecx,%edi /* copy backwards. */ addl %ecx,%esi - std - andl $3,%ecx /* any fractional bytes? */ decl %edi decl %esi + andl $3,%ecx /* any fractional bytes? */ + std rep movsb movl 20(%esp),%ecx /* copy remainder by words */ |