Check the files to see how they do this things with ports and registers. Francisco Andy David wrote: > > struct { > > unsigned notify : 1; > > unsigned valid : 1; > > unsigned finish : 1; > > unsigned demo : 1; > > unsigned alert : 1; > > unsigned encourage : 1; > > unsigned exercise : 1; > > unsigned grace : 1; > > } flags; > > [...] > > > The compiler can't generate code for : pointer = &flags.notify; > > John, > > (I should preface this by saying I'm not familiar with the > compile you're using.) > > your structure of bit definitions is ok (although I think you > should consider using "unsigned int :1" rather than > just "unsigned :1"), but you can't have a pointer to > a bit (K&R page 150). > > Also, seems to me a bit odd to use a switch to test a variable > that can only have 2 states -- maybe 'if' is more appropriate. > I think an 'if' would be about as efficient as you can get. > > - Andy. > ---------------------------------------------- > Andrew David, Software Manager, Ultronics Ltd > http://www.Ultronics.com > > _____________________________________________________________________ > This message has been checked for all known viruses by Star Internet > delivered through the MessageLabs Virus Scanning Service. For further > information visit http://www.star.net.uk/stats.asp or alternatively call > Star Internet for details on the Virus Scanning Service. > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads