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
bfill(dst, len, fill) moves "len" fill characters to "dst".
25
Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').
27
Note: the "b" routines are there to exploit certain VAX order codes,
28
but the MOVC5 instruction will only move 65535 characters. The asm
29
code is presented for your interest and amusement.
32
#include <my_global.h>
35
#if !defined(bfill) && !defined(HAVE_BFILL)
39
void bfill(dst, len, fill)
42
int fill; /* actually char */
44
asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)");
47
#elif defined(MC68000) && defined(DS90)
49
void bfill(dst, len,fill) /* Optimized with long-fill */
54
asm(" movl 8.(a7),d1 ");
56
asm(" movl 4.(a7),a0 ");
58
asm(" movb 15.(a7),d0 ");
69
asm(" movb d0,(a0)+ ");
71
asm(".L1: movl d1,d2 ");
74
asm(" movw d0,(a0)+ ");
76
asm(".L3: movl d0,(a0)+ ");
77
asm(".L2: dbra d2,.L3 ");
83
asm(" movb d0,(a0) ");
84
asm(".L8: movl a1,d2 ");
89
void bfill(dst, len, fill)
94
while (len-- != 0) *dst++ = fill;