MOV  A,P1        ; load current state of bits 0...3
..
..
XRL  P1,A        ; change not masked bits