fix panel_scroll_pages start page
[midnight-commander.git] / slang / slmemset.c
blobebbe057647add00cc36cd74101c1787bb4b86e2d
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"
21 void SLmemset(char *p, char space, int n)
23 #if defined(msdos) && !defined(__WIN32__) && !defined(__GO32__)
24 asm mov al, space
25 asm mov dx, di
26 asm mov cx, n
27 asm les di, p
28 asm cld
29 asm rep stosb
30 asm mov di, dx
31 #else
32 register char *pmax;
34 pmax = p + (n - 4);
35 n = n % 4;
36 while (p <= pmax)
38 *p++ = space; *p++ = space; *p++ = space; *p++= space;
40 while (n--) *p++ = space;
41 #endif