2
Author : Richard A. O'Keefe.
3
Michael Widenius; ifdef MC68000
7
bfill(dst, len, fill) moves "len" fill characters to "dst".
8
Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').
10
Note: the "b" routines are there to exploit certain VAX order codes,
11
but the MOVC5 instruction will only move 65535 characters. The asm
12
code is presented for your interest and amusement.
18
#if !defined(bfill) && !defined(HAVE_BFILL)
22
void bfill(dst, len, fill)
25
int fill; /* actually char */
27
asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)");
30
#elif defined(MC68000) && defined(DS90)
32
void bfill(dst, len,fill) /* Optimized with long-fill */
37
asm(" movl 8.(a7),d1 ");
39
asm(" movl 4.(a7),a0 ");
41
asm(" movb 15.(a7),d0 ");
52
asm(" movb d0,(a0)+ ");
54
asm(".L1: movl d1,d2 ");
57
asm(" movw d0,(a0)+ ");
59
asm(".L3: movl d0,(a0)+ ");
60
asm(".L2: dbra d2,.L3 ");
66
asm(" movb d0,(a0) ");
67
asm(".L8: movl a1,d2 ");
72
void bfill(dst, len, fill)
77
while (len-- != 0) *dst++ = fill;