OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [insight/] [libiberty/] [bcopy.c] - Blame information for rev 1768

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 578 markom
/* bcopy -- copy memory regions of arbitary length
2
 
3
NAME
4
        bcopy -- copy memory regions of arbitrary length
5
 
6
SYNOPSIS
7
        void bcopy (char *in, char *out, int length)
8
 
9
DESCRIPTION
10
        Copy LENGTH bytes from memory region pointed to by IN to memory
11
        region pointed to by OUT.
12
 
13
BUGS
14
        Significant speed improvements can be made in some cases by
15
        implementing copies of multiple bytes simultaneously, or unrolling
16
        the copy loop.
17
 
18
*/
19
 
20
void
21
bcopy (src, dest, len)
22
  register char *src, *dest;
23
  int len;
24
{
25
  if (dest < src)
26
    while (len--)
27
      *dest++ = *src++;
28
  else
29
    {
30
      char *lasts = src + (len-1);
31
      char *lastd = dest + (len-1);
32
      while (len--)
33
        *(char *)lastd-- = *(char *)lasts--;
34
    }
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.