Can a variable be mapped to the upper nibble of a byte?
Posted: Thu Mar 03, 2005 10:26 am
I would like to define a variable to the upper nibble of Port B for the INT_RB interrupt. How can I define this instead of masking out the rest of the entire port B byte? For ex:
#byte port_b=0x06; // verify actual location in device's datasheet
...
unsigned char discs;
discs = port_b >> 4;
There is no masking necessary here. After a boolean, a char is the next size unit can get.
dan king
Joined: 22 Sep 2003 Posts: 119
Posted: Thu Mar 03, 2005 12:10 pm
nothing is wrong with that, as a matter of fact that's how I'm currently doing it. I just wanted to know if there was a way to specify the port bits used as in the following, instead of starting at bit 0.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum