Category : C Source Code
Archive   : ECSTR.ZIP
Filename : BZERO.C

Output of file : BZERO.C contained in archive : ECSTR.ZIP
/* File : bzero.c
Author : Richard A. O'Keefe.
Updated: 23 April 1984
Defines: bzero()

bzero(dst, len) moves "len" 0 bytes to "dst".
Thus to clear a disc buffer to 0s do bzero(buffer, BUFSIZ).

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 bzero(dst, len)
char *dst;
int len;
asm("movc5 $0,*4(ap),$0,8(ap),*4(ap)");

#else ~VaxAsm

void bzero(dst, len)
register char *dst;
register int len;
while (--len >= 0) *dst++ = 0;

#endif VaxAsm

  3 Responses to “Category : C Source Code
Archive   : ECSTR.ZIP
Filename : BZERO.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: