Category : C Source Code
Archive   : CRC4MSC.ZIP
Filename : CRC.DOC
FAST CRC ROUTINES FOR MICROSOFT C
Mike Dumdei, 6 Holly Lane, Texarkana TX 75503
Included in this ARC file are some fast CRC routines for use with MSC.
These routines are 2 to 3 times faster than their C counterparts even
with the C functions using register variables. The routines support
SMALL, MEDIUM, COMPACT, LARGE, and HUGE memory models, however, the
block CRC calculator can not handle blocks that overlap segments. Unless
you have some exotic application that shouldn't be a problem.
To assemble for:
SMALL model -- masm crc /mx;
COMPACT model -- masm crc /dcompact /mx;
MEDIUM model -- masm crc /dmedium /mx;
LARGE model -- masm crc /dlarge /mx;
HUGE model -- masm crc /dhuge /mx;
The large and huge object code generated will be identical.
Two types of functions are provided. The first is a CRC routine for use
on blocks of data:
int calc_crc(char *, int); /* function declaration */
BLOCK MODE USE:
for (x = 0; x < 128; x++)
async_tx(COM1, block[x]); /* get block to tx buf ASAP */
crc = calc_crc(block, 128); /* calc CRC while block is tx'ing */
The other type of CRC calculator is one that works on character at a
time data:
int update_crc(int, char); /* function declaration */
CHAR AT A TIME USE:
for (x = crc = 0; x < 128; x++) {
char_in = async_rx(COM1);
store(char_in);
crc = update_crc(crc, char_in); /* keep CRC curnt so will be rdy */
} /* when entire block has been rx'd */
To use this version you initially set 'crc' to zero and then after each
call to the function the CRC is updated.
I can be reached at:
SPLIT UP THE MIDDLE BBS 214 838-6713
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/