1
/* Copyright (C) 2002 MySQL AB
3
This library is free software; you can redistribute it and/or
4
modify it under the terms of the GNU Library General Public
5
License as published by the Free Software Foundation; version 2
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Library General Public License for more details.
13
You should have received a copy of the GNU Library General Public
14
License along with this library; if not, write to the Free
15
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19
Author : Richard A. O'Keefe.
20
Michael Widenius; ifdef MC68000
21
Updated: 23 April 1984
24
bmove(dst, src, len) moves exactly "len" bytes from the source "src"
25
to the destination "dst". It does not check for NUL characters as
26
strncpy() and strnmov() do. Thus if your C compiler doesn't support
27
structure assignment, you can simulate it with
28
bmove(&to, &from, sizeof from);
29
The standard 4.2bsd routine for this purpose is bcopy. But as bcopy
30
has its first two arguments the other way around you may find this a
31
bit easier to get right.
34
Note: the "b" routines are there to exploit certain VAX order codes,
35
but the MOVC3 instruction will only move 65535 characters. The asm
36
code is presented for your interest and amusement.
39
#include <my_global.h>
42
#if !defined(HAVE_BMOVE) && !defined(bmove)
46
void bmove(dst, src, len)
50
asm("movc3 12(ap),*8(ap),*4(ap)");
54
#if defined(MC68000) && defined(DS90)
56
void bmove(dst, src, len)
58
uint len; /* 0 <= len <= 65535 */
60
asm(" movl 12(a7),d0 ");
63
asm(" movl 4(a7),a1 ");
64
asm(" movl 8(a7),a0 ");
65
asm(".L4: movb (a0)+,(a1)+ ");
71
void bmove(dst, src, len)
73
register const char *src;
76
while (len-- != 0) *dst++ = *src++;