Reading value of bit in PxIN register
You want to read PxIN and then use a bitwise AND that puts the result in another variable.

e.g. result = PxIN &amp; (1&lt;&lt;n) to read the n-th bit.

Besides, (at least with CCS and I think - but I have no way to test - with GCC, it might change with other compilers) instead of doing bit shifts, the msp430.h header defines a BITn constant which you can use here.