i am using keil for c in 8052. in this masking is used or keyword like sbit in manner as follows
sbit variable_name = pin # ;
this is to read form pins. to read , firs declare all pins as e.g
define num P0 ;
num = 0xFF;
for masking :
for example i want to reach bit 3 of port 1 then ;
define num P1;
unsinged int mask = 0x08 ; // temporary value
0000 1000 as i want to read bit 3 .
now i make a variable to store readed bit .
unsigned int get;
get = mask & num;