⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bfill.c

📁 Many C samples. It is a good sample for students to learn C language.
💻 C
字号:
/*  File   : bfill.c
    Author : Richard A. O'Keefe.
    Updated: 23 April 1984
    Defines: bfill()

    bfill(dst, len, fill) moves "len" fill characters to "dst".
    Thus to set a buffer to 80 spaces, do bfill(buff, 80, ' ').

    Note: the "b" routines are there to exploit certain VAX order codes,
    but the MOVC5 instruction will only move 65535 characters.   The asm
    code is presented for your interest and amusement.
*/

#include "strings.h"

#if	VaxAsm

void bfill(dst, len, fill)
    char *dst;
    int len;
    int fill;	/* actually char */
    {
	asm("movc5 $0,*4(ap),12(ap),8(ap),*4(ap)");
    }

#else  ~VaxAsm

void bfill(dst, len, fill)
    register char *dst;
    register int len;
    register int fill;	/* char */
    {
	while (--len >= 0) *dst++ = fill;

    }

#endif	VaxAsm

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -