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

📄 addbfcrc.c

📁 汇编大全 中国矿业大学计算机学院 汇编实验5
💻 C
字号:
#ifndef LINT
static char sccsid[]="@(#) addbfcrc.c 2.2 88/01/29 17:04:31";
#endif /* LINT */

#include "options.h"
/*
addbfcrc() accepts a buffer address and a count and adds the CRC for
all bytes in the buffer to the global variable crccode using
CRC-16.

CRC computation algorithm originally from an article by David Schwaderer 
in the April 1985 issue of PC Tech Journal.

Loop optimization done by J. Brian Waters.

I claim no copyright over the contents of this file.

                                    -- Rahul Dhesi 1986/08/27

*/

extern unsigned int crccode;
extern unsigned crctab[];

void addbfcrc(buffer,count)
register char *buffer;
register int count;

{
   register unsigned int localcrc;
   localcrc = crccode;

   for (; count--; )
      localcrc = (localcrc>>8) ^ crctab[(localcrc ^ (*buffer++)) & 0x00ff];
   crccode = localcrc;
}

⌨️ 快捷键说明

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