DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T b

⟦d911db6a5⟧ TextFile

    Length: 789 (0x315)
    Types: TextFile
    Names: »bzero.c«

Derivation

└─⟦a0efdde77⟧ Bits:30001252 EUUGD11 Tape, 1987 Spring Conference Helsinki
    └─ ⟦this⟧ »EUUGD11/euug-87hel/sec8/top/bzero.c« 

TextFile

/*
 *  Fast, sleazy, and ugly zero function.
 *
 *  Note that this will only work on a VAX, but it is real easy to write a
 *  similar function for whatever machine you may need.  If nothing else,
 *  just a simple loop in C will suffice.
 *
 *  Dave Johnson, Rice University.
 *
 *  Enhanced by William LeFebvre of Rice University to handle zeroing more
 *  than 64K.
 */

# define   K	1024

/*
 *  bzero(memory, amount) - set "amount" bytes starting at "memory" to the
 *			    value 0.
 */

bzero(memory, amount)

char *memory;
int  amount;

{
    while (amount >= 64*K)
    {
	_bzero64(memory, 64*K-1);
	memory += 64*K-1;
	amount -= 64*K-1;
    }
    _bzero64(memory, amount);
}

_bzero64(memory, amount)

char *memory;
int  amount;

{
    asm("	movc5	$0, (sp), $0, 8(ap), *4(ap)");
}