Logic Characters code

Hi

What is the code used to say port2 = port2 anded with 0x7f This will clear all bits of port 2 but bit 7?

I thought it was

P2 &= 0x7f

this doesnt work, so i tried

P2 = (P2 && x7f)

This also didnt work. Anyone know what it is?

More questions in this forum