De-fuzzyed some msgs...
[midnight-commander.git] / slang / slmemset.c
bloba83ae19193b1e73865d650ed0df929c495119802
1 /* Copyright (c) 1992, 1995 John E. Davis
2 * All rights reserved.
3 *
4 * You may distribute under the terms of either the GNU General Public
5 * License or the Perl Artistic License.
6 */
9 /* These routines are fast memcpy, memset routines. When available, I
10 use system rouines. For msdos, I use inline assembly. */
12 /* The current versions only work in the forward direction only!! */
14 #include "config.h"
16 #include <stdio.h>
19 #include "slang.h"
20 #include "_slang.h"
22 void SLmemset(char *p, char space, int n)
24 #if defined(msdos) && !defined(__WIN32__) && !defined(__GO32__)
25 asm mov al, space
26 asm mov dx, di
27 asm mov cx, n
28 asm les di, p
29 asm cld
30 asm rep stosb
31 asm mov di, dx
32 #else
33 register char *pmax;
35 pmax = p + (n - 4);
36 n = n % 4;
37 while (p <= pmax)
39 *p++ = space; *p++ = space; *p++ = space; *p++= space;
41 while (n--) *p++ = space;
42 #endif