|
|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 448 (0x1c0)
Types: TextFile
Names: »bits.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987
└─⟦this⟧ »EUUGD18/General/Spacewar/bits.c«
/*
* 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);
}