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 - metrics - download

⟦08a9431f9⟧ TextFile

    Length: 448 (0x1c0)
    Types: TextFile
    Names: »bits.c«

Derivation

└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
    └─⟦this⟧ »EUUGD18/General/Spacewar/bits.c« 

TextFile

/*
 * Spacewar - turn bits on, off, and return value
 *
 * Copyright 1985 obo Systems, Inc.
 * Copyright 1985 Dan Rosenblatt
 */

#include "spacewar.h"

#define BPB	8	/* bits per byte */

VOID biton(ary,bitno)
char ary[];
int bitno;
{
	ary[bitno/BPB] |= 1<<(bitno%BPB);
}

VOID bitoff(ary,bitno)
char ary[];
int bitno;
{
	ary[bitno/BPB] &= ~(1<<(bitno%BPB));
}

nabit(ary,bitno)
char ary[];
int bitno;
{
	return((ary[bitno/BPB]>>(bitno%BPB))&1);
}