Article View: comp.std.c
Article #121Help with bit and byte addressable bitfields
From: Ken Bass
Date: Sun, 26 Jul 1992 04:39
Date: Sun, 26 Jul 1992 04:39
23 lines
1103 bytes
1103 bytes
I'd like to know your suggestions on how to define and access a bitfield
that is both bit and byte addressable. The application is to maintain a
ram image in a memory mapped i/o system.
Lets say we have WidgetRamImg of type WidgetRamImgDef where
typedef struct {
unsigned int bit0;
...
unsigned int bit32;
} WidgetRamImgDef;
WidgetRamImgDef WidgetRamImg;
I'd like to say WidgetRamImg=0x0; at init time, but the type is wrong.
Casting to WidgetRamImgDef does not work either.
Any suggestions?
--
Ken Bass (kbass@gmuvax2.gmu.edu) | Telecommunications
George Mason University | Techniques Corp,
Student, Department of Electrical Engineering | Software Engineer
Technical Details
Message-ID:
<1992Jul26.043900.7020@gmuvax2.gmu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!kbassShow Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!sparky!uunet!haven.umd.edu!news.umbc.edu!gmuvax2!kbass From: kbass@gmuvax2.gmu.edu (Ken Bass) Subject: Help with bit and byte addressable bitfields Message-ID: <1992Jul26.043900.7020@gmuvax2.gmu.edu> Organization: George Mason University, Fairfax, Va. Distribution: na Date: Sun, 26 Jul 1992 04:39:00 GMT Lines: 23